diff --git a/hipamd/hipify-clang/src/ArgParse.cpp b/hipamd/hipify-clang/src/ArgParse.cpp index b27643710f..4211ddd8d6 100644 --- a/hipamd/hipify-clang/src/ArgParse.cpp +++ b/hipamd/hipify-clang/src/ArgParse.cpp @@ -2,39 +2,27 @@ cl::OptionCategory ToolTemplateCategory("CUDA to HIP source translator options"); -cl::opt OutputFilename("o", - cl::desc("Output filename"), - cl::value_desc("filename"), - cl::cat(ToolTemplateCategory)); +cl::opt OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"), + cl::cat(ToolTemplateCategory)); cl::opt Inplace("inplace", - cl::desc("Modify input file inplace, replacing input with hipified output, save backup in .prehip file"), - cl::value_desc("inplace"), - cl::cat(ToolTemplateCategory)); + cl::desc("Modify input file inplace, replacing input with hipified output, " + "save backup in .prehip file"), + cl::value_desc("inplace"), cl::cat(ToolTemplateCategory)); -cl::opt NoBackup("no-backup", - cl::desc("Don't create a backup file for the hipified source"), - cl::value_desc("no-backup"), - cl::cat(ToolTemplateCategory)); +cl::opt NoBackup("no-backup", cl::desc("Don't create a backup file for the hipified source"), + cl::value_desc("no-backup"), cl::cat(ToolTemplateCategory)); -cl::opt NoOutput("no-output", - cl::desc("Don't write any translated output to stdout"), - cl::value_desc("no-output"), - cl::cat(ToolTemplateCategory)); +cl::opt NoOutput("no-output", cl::desc("Don't write any translated output to stdout"), + cl::value_desc("no-output"), cl::cat(ToolTemplateCategory)); -cl::opt PrintStats("print-stats", - cl::desc("Print translation statistics"), - cl::value_desc("print-stats"), - cl::cat(ToolTemplateCategory)); +cl::opt PrintStats("print-stats", cl::desc("Print translation statistics"), + cl::value_desc("print-stats"), cl::cat(ToolTemplateCategory)); -cl::opt OutputStatsFilename("o-stats", - cl::desc("Output filename for statistics"), - cl::value_desc("filename"), - cl::cat(ToolTemplateCategory)); +cl::opt OutputStatsFilename("o-stats", cl::desc("Output filename for statistics"), + cl::value_desc("filename"), cl::cat(ToolTemplateCategory)); -cl::opt Examine("examine", - cl::desc("Combines -no-output and -print-stats options"), - cl::value_desc("examine"), - cl::cat(ToolTemplateCategory)); +cl::opt Examine("examine", cl::desc("Combines -no-output and -print-stats options"), + cl::value_desc("examine"), cl::cat(ToolTemplateCategory)); cl::extrahelp CommonHelp(ct::CommonOptionsParser::HelpMessage); diff --git a/hipamd/hipify-clang/src/CUDA2HipMap.cpp b/hipamd/hipify-clang/src/CUDA2HipMap.cpp index 47358802e9..4995786861 100644 --- a/hipamd/hipify-clang/src/CUDA2HipMap.cpp +++ b/hipamd/hipify-clang/src/CUDA2HipMap.cpp @@ -3,46 +3,56 @@ /// Maps the names of CUDA types to the corresponding hip types. const std::map CUDA_TYPE_NAME_MAP{ // Error codes and return types - {"CUresult", {"hipError_t", CONV_TYPE, API_DRIVER}}, -// {"cudaError_enum", {"hipError_t", CONV_TYPE, API_DRIVER}}, + {"CUresult", {"hipError_t", CONV_TYPE, API_DRIVER}}, + // {"cudaError_enum", {"hipError_t", CONV_TYPE, API_DRIVER}}, {"cudaError_t", {"hipError_t", CONV_TYPE, API_RUNTIME}}, - {"cudaError", {"hipError_t", CONV_TYPE, API_RUNTIME}}, + {"cudaError", {"hipError_t", CONV_TYPE, API_RUNTIME}}, ///////////////////////////// CUDA DRIVER API ///////////////////////////// - {"CUDA_ARRAY3D_DESCRIPTOR", {"HIP_ARRAY3D_DESCRIPTOR", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUDA_ARRAY_DESCRIPTOR", {"HIP_ARRAY_DESCRIPTOR", CONV_TYPE, API_DRIVER}}, - {"CUDA_MEMCPY2D", {"hip_Memcpy2D", CONV_TYPE, API_DRIVER}}, - {"CUDA_MEMCPY3D", {"HIP_MEMCPY3D", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUDA_MEMCPY3D_PEER", {"HIP_MEMCPY3D_PEER", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUDA_POINTER_ATTRIBUTE_P2P_TOKENS", {"HIP_POINTER_ATTRIBUTE_P2P_TOKENS", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUDA_RESOURCE_DESC", {"HIP_RESOURCE_DESC", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUDA_RESOURCE_VIEW_DESC", {"HIP_RESOURCE_VIEW_DESC", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUDA_ARRAY3D_DESCRIPTOR", {"HIP_ARRAY3D_DESCRIPTOR", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUDA_ARRAY_DESCRIPTOR", {"HIP_ARRAY_DESCRIPTOR", CONV_TYPE, API_DRIVER}}, + {"CUDA_MEMCPY2D", {"hip_Memcpy2D", CONV_TYPE, API_DRIVER}}, + {"CUDA_MEMCPY3D", {"HIP_MEMCPY3D", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUDA_MEMCPY3D_PEER", {"HIP_MEMCPY3D_PEER", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUDA_POINTER_ATTRIBUTE_P2P_TOKENS", + {"HIP_POINTER_ATTRIBUTE_P2P_TOKENS", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUDA_RESOURCE_DESC", {"HIP_RESOURCE_DESC", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUDA_RESOURCE_VIEW_DESC", {"HIP_RESOURCE_VIEW_DESC", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, {"CUipcEventHandle", {"hipIpcEventHandle", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUipcMemHandle", {"hipIpcMemHandle", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUipcMemHandle", {"hipIpcMemHandle", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUaddress_mode", {"hipAddress_mode", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUarray_cubemap_face", {"hipArray_cubemap_face", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUarray_format", {"hipArray_format", CONV_TYPE, API_DRIVER}}, - {"CUcomputemode", {"hipComputemode", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_RUNTIME ANALOGUE (cudaComputeMode) - {"CUmem_advise", {"hipMemAdvise", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_RUNTIME ANALOGUE (cudaComputeMode) - {"CUmem_range_attribute", {"hipMemRangeAttribute", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_RUNTIME ANALOGUE (cudaMemRangeAttribute) - {"CUctx_flags", {"hipCctx_flags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUaddress_mode", {"hipAddress_mode", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUarray_cubemap_face", {"hipArray_cubemap_face", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUarray_format", {"hipArray_format", CONV_TYPE, API_DRIVER}}, + {"CUcomputemode", + {"hipComputemode", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // API_RUNTIME ANALOGUE (cudaComputeMode) + {"CUmem_advise", + {"hipMemAdvise", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // API_RUNTIME ANALOGUE (cudaComputeMode) + {"CUmem_range_attribute", + {"hipMemRangeAttribute", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // API_RUNTIME ANALOGUE (cudaMemRangeAttribute) + {"CUctx_flags", {"hipCctx_flags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // NOTE: CUdevice might be changed to typedef int in the future. - {"CUdevice", {"hipDevice_t", CONV_TYPE, API_DRIVER}}, - {"CUdevice_attribute_enum", {"hipDeviceAttribute_t", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaDeviceAttr) - {"CUdevice_attribute", {"hipDeviceAttribute_t", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaDeviceAttr) - {"CUdeviceptr", {"hipDeviceptr_t", CONV_TYPE, API_DRIVER}}, + {"CUdevice", {"hipDevice_t", CONV_TYPE, API_DRIVER}}, + {"CUdevice_attribute_enum", + {"hipDeviceAttribute_t", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaDeviceAttr) + {"CUdevice_attribute", + {"hipDeviceAttribute_t", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaDeviceAttr) + {"CUdeviceptr", {"hipDeviceptr_t", CONV_TYPE, API_DRIVER}}, - // CUDA: "The types::CUarray and struct ::cudaArray * represent the same data type and may be used interchangeably by casting the two types between each other." + // CUDA: "The types::CUarray and struct ::cudaArray * represent the same data type and may be + // used interchangeably by casting the two types between each other." // typedef struct cudaArray *cudaArray_t; // typedef struct CUarray_st *CUarray; - {"CUarray_st", {"hipArray", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaArray) - {"CUarray", {"hipArray *", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaArray_t) + {"CUarray_st", {"hipArray", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaArray) + {"CUarray", {"hipArray *", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaArray_t) {"CUdevprop_st", {"hipDeviceProp_t", CONV_TYPE, API_DRIVER}}, - {"CUdevprop", {"hipDeviceProp_t", CONV_TYPE, API_DRIVER}}, + {"CUdevprop", {"hipDeviceProp_t", CONV_TYPE, API_DRIVER}}, // pointer to CUfunc_st {"CUfunction", {"hipFunction_t", CONV_TYPE, API_DRIVER}}, @@ -54,106 +64,147 @@ const std::map CUDA_TYPE_NAME_MAP{ // typedef struct CUgraphicsResource_st *CUgraphicsResource; {"CUgraphicsResource", {"hipGraphicsResource_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // typedef struct CUmipmappedArray_st *CUmipmappedArray; - {"CUmipmappedArray", {"hipMipmappedArray_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUmipmappedArray", {"hipMipmappedArray_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUfunction_attribute", {"hipFuncAttribute_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUfunction_attribute", {"hipFuncAttribute_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, {"CUfunction_attribute_enum", {"hipFuncAttribute_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUgraphicsMapResourceFlags", {"hipGraphicsMapFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsMapFlags) - {"CUgraphicsMapResourceFlags_enum", {"hipGraphicsMapFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsMapFlags) + {"CUgraphicsMapResourceFlags", + {"hipGraphicsMapFlags", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsMapFlags) + {"CUgraphicsMapResourceFlags_enum", + {"hipGraphicsMapFlags", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsMapFlags) - {"CUgraphicsRegisterFlags", {"hipGraphicsRegisterFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsRegisterFlags) - {"CUgraphicsRegisterFlags_enum", {"hipGraphicsRegisterFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsRegisterFlags) + {"CUgraphicsRegisterFlags", + {"hipGraphicsRegisterFlags", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsRegisterFlags) + {"CUgraphicsRegisterFlags_enum", + {"hipGraphicsRegisterFlags", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsRegisterFlags) - {"CUoccupancy_flags", {"hipOccupancyFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) - {"CUoccupancy_flags_enum", {"hipOccupancyFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + {"CUoccupancy_flags", + {"hipOccupancyFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + {"CUoccupancy_flags_enum", + {"hipOccupancyFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) - {"CUfunc_cache_enum", {"hipFuncCache", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaFuncCache) - {"CUfunc_cache", {"hipFuncCache", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaFuncCache) + {"CUfunc_cache_enum", + {"hipFuncCache", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaFuncCache) + {"CUfunc_cache", + {"hipFuncCache", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaFuncCache) - {"CUipcMem_flags", {"hipIpcMemFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) - {"CUipcMem_flags_enum", {"hipIpcMemFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + {"CUipcMem_flags", + {"hipIpcMemFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + {"CUipcMem_flags_enum", + {"hipIpcMemFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) - {"CUjit_cacheMode", {"hipJitCacheMode", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + {"CUjit_cacheMode", + {"hipJitCacheMode", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) {"CUjit_cacheMode_enum", {"hipJitCacheMode", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUjit_fallback", {"hipJitFallback", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + {"CUjit_fallback", + {"hipJitFallback", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) {"CUjit_fallback_enum", {"hipJitFallback", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUjit_option", {"hipJitOption", CONV_JIT, API_DRIVER}}, // API_Runtime ANALOGUE (no) + {"CUjit_option", {"hipJitOption", CONV_JIT, API_DRIVER}}, // API_Runtime ANALOGUE (no) {"CUjit_option_enum", {"hipJitOption", CONV_JIT, API_DRIVER}}, - {"CUjit_target", {"hipJitTarget", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + {"CUjit_target", + {"hipJitTarget", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) {"CUjit_target_enum", {"hipJitTarget", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUjitInputType", {"hipJitInputType", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + {"CUjitInputType", + {"hipJitInputType", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) {"CUjitInputType_enum", {"hipJitInputType", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUlimit", {"hipLimit_t", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaLimit) - {"CUlimit_enum", {"hipLimit_t", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaLimit) + {"CUlimit", {"hipLimit_t", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaLimit) + {"CUlimit_enum", {"hipLimit_t", CONV_TYPE, API_DRIVER}}, // API_Runtime ANALOGUE (cudaLimit) - {"CUmemAttach_flags", {"hipMemAttachFlags_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) - {"CUmemAttach_flags_enum", {"hipMemAttachFlags_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + {"CUmemAttach_flags", + {"hipMemAttachFlags_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + {"CUmemAttach_flags_enum", + {"hipMemAttachFlags_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) - {"CUmemorytype", {"hipMemType_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no - cudaMemoryType is not an analogue) - {"CUmemorytype_enum", {"hipMemType_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no - cudaMemoryType is not an analogue) + {"CUmemorytype", + {"hipMemType_t", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no - cudaMemoryType is not an analogue) + {"CUmemorytype_enum", + {"hipMemType_t", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no - cudaMemoryType is not an analogue) - {"CUresourcetype", {"hipResourceType", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaResourceType) - {"CUresourcetype_enum", {"hipResourceType", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaResourceType) + {"CUresourcetype", + {"hipResourceType", CONV_TEX, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaResourceType) + {"CUresourcetype_enum", + {"hipResourceType", CONV_TEX, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaResourceType) - {"CUresourceViewFormat", {"hipResourceViewFormat", CONV_TEX, API_DRIVER}}, // API_Runtime ANALOGUE (cudaResourceViewFormat) - {"CUresourceViewFormat_enum", {"hipResourceViewFormat", CONV_TEX, API_DRIVER}}, // API_Runtime ANALOGUE (cudaResourceViewFormat) + {"CUresourceViewFormat", + {"hipResourceViewFormat", CONV_TEX, + API_DRIVER}}, // API_Runtime ANALOGUE (cudaResourceViewFormat) + {"CUresourceViewFormat_enum", + {"hipResourceViewFormat", CONV_TEX, + API_DRIVER}}, // API_Runtime ANALOGUE (cudaResourceViewFormat) - {"CUsharedconfig", {"hipSharedMemConfig", CONV_TYPE, API_DRIVER}}, + {"CUsharedconfig", {"hipSharedMemConfig", CONV_TYPE, API_DRIVER}}, {"CUsharedconfig_enum", {"hipSharedMemConfig", CONV_TYPE, API_DRIVER}}, - {"CUcontext", {"hipCtx_t", CONV_TYPE, API_DRIVER}}, + {"CUcontext", {"hipCtx_t", CONV_TYPE, API_DRIVER}}, // TODO: move "typedef struct ihipCtx_t *hipCtx_t;" from hcc_details to HIP // typedef struct CUctx_st *CUcontext; // {"CUctx_st", {"ihipCtx_t", CONV_TYPE, API_DRIVER}}, - {"CUmodule", {"hipModule_t", CONV_TYPE, API_DRIVER}}, + {"CUmodule", {"hipModule_t", CONV_TYPE, API_DRIVER}}, // TODO: move "typedef struct ihipModule_t *hipModule_t;" from hcc_details to HIP // typedef struct CUmod_st *CUmodule; // {"CUmod_st", {"ihipModule_t", CONV_TYPE, API_DRIVER}}, - {"CUstream", {"hipStream_t", CONV_TYPE, API_DRIVER}}, + {"CUstream", {"hipStream_t", CONV_TYPE, API_DRIVER}}, // TODO: move "typedef struct ihipStream_t *hipStream_t;" from hcc_details to HIP // typedef struct CUstream_st *CUstream; // {"CUstream_st", {"ihipStream_t", CONV_TYPE, API_DRIVER}}, - // typedef void (*hipStreamCallback_t) (hipStream_t stream, hipError_t status, void* userData); + // typedef void (*hipStreamCallback_t) (hipStream_t stream, hipError_t status, void* + // userData); // typedef void (CUDA_CB *CUstreamCallback) (CUstream hStream, CUresult status, void* userData) - {"CUstreamCallback", {"hipStreamCallback_t", CONV_TYPE, API_DRIVER}}, + {"CUstreamCallback", {"hipStreamCallback_t", CONV_TYPE, API_DRIVER}}, - {"CUsurfObject", {"hipSurfaceObject", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUsurfObject", {"hipSurfaceObject", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // typedef struct CUsurfref_st *CUsurfref; - {"CUsurfref", {"hipSurfaceReference_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUsurfref", {"hipSurfaceReference_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // {"CUsurfref_st", {"ihipSurfaceReference_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUtexObject", {"hipTextureObject_t", CONV_TYPE, API_DRIVER}}, + {"CUtexObject", {"hipTextureObject_t", CONV_TYPE, API_DRIVER}}, // typedef struct CUtexref_st *CUtexref; - {"CUtexref", {"textureReference", CONV_TYPE, API_DRIVER}}, + {"CUtexref", {"textureReference", CONV_TYPE, API_DRIVER}}, // {"CUtexref_st", {"ihipTextureReference_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // Stream Flags enum - {"CUstream_flags", {"hipStreamFlags", CONV_TYPE, API_DRIVER}}, + {"CUstream_flags", {"hipStreamFlags", CONV_TYPE, API_DRIVER}}, // TODO: ..? // {"CUstream_flags_enum", {"hipStreamFlags", CONV_TYPE, API_DRIVER}}, - {"CUstreamWaitValue_flags", {"hipStreamWaitValueFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUstreamWaitValue_flags", + {"hipStreamWaitValueFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // TODO: ..? - // {"CUstreamWaitValue_flags_enum", {"hipStreamWaitValueFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + // {"CUstreamWaitValue_flags_enum", {"hipStreamWaitValueFlags", CONV_TYPE, API_DRIVER, + // HIP_UNSUPPORTED}}, - {"CUstreamWriteValue_flags", {"hipStreamWriteValueFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - // {"CUstreamWriteValue_flags", {"hipStreamWriteValueFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUstreamWriteValue_flags", + {"hipStreamWriteValueFlags", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + // {"CUstreamWriteValue_flags", {"hipStreamWriteValueFlags", CONV_TYPE, API_DRIVER, + // HIP_UNSUPPORTED}}, {"CUstreamBatchMemOpType", {"hipStreamBatchMemOpType", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - // {"CUstreamBatchMemOpType_enum", {"hipStreamBatchMemOpType", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + // {"CUstreamBatchMemOpType_enum", {"hipStreamBatchMemOpType", CONV_TYPE, API_DRIVER, + // HIP_UNSUPPORTED}}, // P2P Attributes - {"CUdevice_P2PAttribute", {"hipDeviceP2PAttribute", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaDeviceP2PAttr) - // {"CUdevice_P2PAttribute_enum", {"hipDeviceP2PAttribute", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUdevice_P2PAttribute", + {"hipDeviceP2PAttribute", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaDeviceP2PAttr) + // {"CUdevice_P2PAttribute_enum", {"hipDeviceP2PAttribute", CONV_TYPE, API_DRIVER, + // HIP_UNSUPPORTED}}, // pointer to CUevent_st - {"CUevent", {"hipEvent_t", CONV_TYPE, API_DRIVER}}, + {"CUevent", {"hipEvent_t", CONV_TYPE, API_DRIVER}}, // ToDo: // {"CUevent_st", {"XXXX", CONV_TYPE, API_DRIVER}}, // Event Flags @@ -161,247 +212,327 @@ const std::map CUDA_TYPE_NAME_MAP{ // ToDo: // {"CUevent_flags_enum", {"hipEventFlags", CONV_EVENT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUfilter_mode", {"hipTextureFilterMode", CONV_TEX, API_DRIVER}}, // API_Runtime ANALOGUE (cudaTextureFilterMode) + {"CUfilter_mode", + {"hipTextureFilterMode", CONV_TEX, + API_DRIVER}}, // API_Runtime ANALOGUE (cudaTextureFilterMode) // ToDo: - // {"CUfilter_mode", {"CUfilter_mode_enum", CONV_TEX, API_DRIVER}}, // API_Runtime ANALOGUE (cudaTextureFilterMode) + // {"CUfilter_mode", {"CUfilter_mode_enum", CONV_TEX, API_DRIVER}}, // API_Runtime + // ANALOGUE (cudaTextureFilterMode) - {"CUGLDeviceList", {"hipGLDeviceList", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLDeviceList) + {"CUGLDeviceList", + {"hipGLDeviceList", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLDeviceList) // {"CUGLDeviceList_enum", {"hipGLDeviceList", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUGLmap_flags", {"hipGLMapFlags", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLMapFlags) + {"CUGLmap_flags", + {"hipGLMapFlags", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLMapFlags) // {"CUGLmap_flags_enum", {"hipGLMapFlags", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUd3d9DeviceList", {"hipD3D9DeviceList", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9DeviceList) + {"CUd3d9DeviceList", + {"hipD3D9DeviceList", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9DeviceList) // {"CUd3d9DeviceList_enum", {"hipD3D9DeviceList", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUd3d9map_flags", {"hipD3D9MapFlags", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9MapFlags) + {"CUd3d9map_flags", + {"hipD3D9MapFlags", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9MapFlags) // {"CUd3d9map_flags_enum", {"hipD3D9MapFlags", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUd3d9register_flags", {"hipD3D9RegisterFlags", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9RegisterFlags) - // {"CUd3d9register_flags_enum", {"hipD3D9RegisterFlags", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUd3d9register_flags", + {"hipD3D9RegisterFlags", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9RegisterFlags) + // {"CUd3d9register_flags_enum", {"hipD3D9RegisterFlags", CONV_D3D9, API_DRIVER, + // HIP_UNSUPPORTED}}, - {"CUd3d10DeviceList", {"hipd3d10DeviceList", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10DeviceList) - // {"CUd3d10DeviceList_enum", {"hipD3D10DeviceList", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUd3d10DeviceList", + {"hipd3d10DeviceList", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10DeviceList) + // {"CUd3d10DeviceList_enum", {"hipD3D10DeviceList", CONV_D3D10, API_DRIVER, + // HIP_UNSUPPORTED}}, - {"CUd3d10map_flags", {"hipD3D10MapFlags", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10MapFlags) + {"CUd3d10map_flags", + {"hipD3D10MapFlags", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10MapFlags) // {"CUd3d10map_flags_enum", {"hipD3D10MapFlags", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, - {"CUd3d10register_flags", {"hipD3D10RegisterFlags", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10RegisterFlags) - // {"CUd3d10register_flags_enum", {"hipD3D10RegisterFlags", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUd3d10register_flags", + {"hipD3D10RegisterFlags", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10RegisterFlags) + // {"CUd3d10register_flags_enum", {"hipD3D10RegisterFlags", CONV_D3D10, API_DRIVER, + // HIP_UNSUPPORTED}}, - {"CUd3d11DeviceList", {"hipd3d11DeviceList", CONV_D3D11, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D11DeviceList) - // {"CUd3d11DeviceList_enum", {"hipD3D11DeviceList", CONV_D3D11, API_DRIVER, HIP_UNSUPPORTED}}, + {"CUd3d11DeviceList", + {"hipd3d11DeviceList", CONV_D3D11, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D11DeviceList) + // {"CUd3d11DeviceList_enum", {"hipD3D11DeviceList", CONV_D3D11, API_DRIVER, + // HIP_UNSUPPORTED}}, // EGL Interoperability - {"CUeglStreamConnection_st", {"hipEglStreamConnection", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEglStreamConnection) - {"CUeglStreamConnection", {"hipEglStreamConnection", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEglStreamConnection) + {"CUeglStreamConnection_st", + {"hipEglStreamConnection", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEglStreamConnection) + {"CUeglStreamConnection", + {"hipEglStreamConnection", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEglStreamConnection) /////////////////////////////// CUDA RT API /////////////////////////////// - {"libraryPropertyType_t", {"hipLibraryPropertyType_t", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"libraryPropertyType", {"hipLibraryPropertyType_t", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"libraryPropertyType_t", + {"hipLibraryPropertyType_t", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"libraryPropertyType", {"hipLibraryPropertyType_t", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, {"cudaStreamCallback_t", {"hipStreamCallback_t", CONV_TYPE, API_RUNTIME}}, // Arrays - {"cudaArray", {"hipArray", CONV_MEM, API_RUNTIME}}, + {"cudaArray", {"hipArray", CONV_MEM, API_RUNTIME}}, // typedef struct cudaArray *cudaArray_t; - {"cudaArray_t", {"hipArray_t", CONV_MEM, API_RUNTIME}}, + {"cudaArray_t", {"hipArray_t", CONV_MEM, API_RUNTIME}}, // typedef const struct cudaArray *cudaArray_const_t; - {"cudaArray_const_t", {"hipArray_const_t", CONV_MEM, API_RUNTIME}}, - {"cudaMipmappedArray_t", {"hipMipmappedArray_t", CONV_MEM, API_RUNTIME}}, + {"cudaArray_const_t", {"hipArray_const_t", CONV_MEM, API_RUNTIME}}, + {"cudaMipmappedArray_t", {"hipMipmappedArray_t", CONV_MEM, API_RUNTIME}}, {"cudaMipmappedArray_const_t", {"hipMipmappedArray_const_t", CONV_MEM, API_RUNTIME}}, // defines - {"cudaArrayDefault", {"hipArrayDefault", CONV_MEM, API_RUNTIME}}, - {"cudaArrayLayered", {"hipArrayLayered", CONV_MEM, API_RUNTIME}}, - {"cudaArraySurfaceLoadStore", {"hipArraySurfaceLoadStore", CONV_MEM, API_RUNTIME}}, - {"cudaArrayCubemap", {"hipArrayCubemap", CONV_MEM, API_RUNTIME}}, - {"cudaArrayTextureGather", {"hipArrayTextureGather", CONV_MEM, API_RUNTIME}}, + {"cudaArrayDefault", {"hipArrayDefault", CONV_MEM, API_RUNTIME}}, + {"cudaArrayLayered", {"hipArrayLayered", CONV_MEM, API_RUNTIME}}, + {"cudaArraySurfaceLoadStore", {"hipArraySurfaceLoadStore", CONV_MEM, API_RUNTIME}}, + {"cudaArrayCubemap", {"hipArrayCubemap", CONV_MEM, API_RUNTIME}}, + {"cudaArrayTextureGather", {"hipArrayTextureGather", CONV_MEM, API_RUNTIME}}, - {"cudaMemoryAdvise", {"hipMemAdvise", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUmem_advise) - {"cudaMemRangeAttribute", {"hipMemRangeAttribute", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUmem_range_attribute) + {"cudaMemoryAdvise", + {"hipMemAdvise", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUmem_advise) + {"cudaMemRangeAttribute", + {"hipMemRangeAttribute", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUmem_range_attribute) {"cudaMemcpyKind", {"hipMemcpyKind", CONV_MEM, API_RUNTIME}}, - {"cudaMemoryType", {"hipMemoryType", CONV_MEM, API_RUNTIME}}, // API_Driver ANALOGUE (no - CUmemorytype is not an analogue) + {"cudaMemoryType", + {"hipMemoryType", CONV_MEM, + API_RUNTIME}}, // API_Driver ANALOGUE (no - CUmemorytype is not an analogue) - {"cudaExtent", {"hipExtent", CONV_MEM, API_RUNTIME}}, + {"cudaExtent", {"hipExtent", CONV_MEM, API_RUNTIME}}, {"cudaPitchedPtr", {"hipPitchedPtr", CONV_MEM, API_RUNTIME}}, - {"cudaPos", {"hipPos", CONV_MEM, API_RUNTIME}}, + {"cudaPos", {"hipPos", CONV_MEM, API_RUNTIME}}, - {"cudaEvent_t", {"hipEvent_t", CONV_TYPE, API_RUNTIME}}, - {"cudaStream_t", {"hipStream_t", CONV_TYPE, API_RUNTIME}}, + {"cudaEvent_t", {"hipEvent_t", CONV_TYPE, API_RUNTIME}}, + {"cudaStream_t", {"hipStream_t", CONV_TYPE, API_RUNTIME}}, {"cudaPointerAttributes", {"hipPointerAttribute_t", CONV_TYPE, API_RUNTIME}}, - {"cudaDeviceAttr", {"hipDeviceAttribute_t", CONV_TYPE, API_RUNTIME}}, // API_DRIVER ANALOGUE (CUdevice_attribute) - {"cudaDeviceProp", {"hipDeviceProp_t", CONV_TYPE, API_RUNTIME}}, - {"cudaDeviceP2PAttr", {"hipDeviceP2PAttribute", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // API_DRIVER ANALOGUE (CUdevice_P2PAttribute) - {"cudaComputeMode", {"hipComputeMode", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // API_DRIVER ANALOGUE (CUcomputemode) - {"cudaFuncCache", {"hipFuncCache_t", CONV_CACHE, API_RUNTIME}}, // API_Driver ANALOGUE (CUfunc_cache) - {"cudaFuncAttributes", {"hipFuncAttributes", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaSharedMemConfig", {"hipSharedMemConfig", CONV_TYPE, API_RUNTIME}}, - {"cudaLimit", {"hipLimit_t", CONV_TYPE, API_RUNTIME}}, // API_Driver ANALOGUE (CUlimit) + {"cudaDeviceAttr", + {"hipDeviceAttribute_t", CONV_TYPE, API_RUNTIME}}, // API_DRIVER ANALOGUE (CUdevice_attribute) + {"cudaDeviceProp", {"hipDeviceProp_t", CONV_TYPE, API_RUNTIME}}, + {"cudaDeviceP2PAttr", + {"hipDeviceP2PAttribute", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_DRIVER ANALOGUE (CUdevice_P2PAttribute) + {"cudaComputeMode", + {"hipComputeMode", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_DRIVER ANALOGUE (CUcomputemode) + {"cudaFuncCache", + {"hipFuncCache_t", CONV_CACHE, API_RUNTIME}}, // API_Driver ANALOGUE (CUfunc_cache) + {"cudaFuncAttributes", {"hipFuncAttributes", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaSharedMemConfig", {"hipSharedMemConfig", CONV_TYPE, API_RUNTIME}}, + {"cudaLimit", {"hipLimit_t", CONV_TYPE, API_RUNTIME}}, // API_Driver ANALOGUE (CUlimit) {"cudaOutputMode", {"hipOutputMode", CONV_OTHER, API_RUNTIME, HIP_UNSUPPORTED}}, // Texture reference management {"cudaTextureReadMode", {"hipTextureReadMode", CONV_TEX, API_RUNTIME}}, - {"cudaTextureFilterMode", {"hipTextureFilterMode", CONV_TEX, API_RUNTIME}}, // API_DRIVER ANALOGUE (CUfilter_mode) + {"cudaTextureFilterMode", + {"hipTextureFilterMode", CONV_TEX, API_RUNTIME}}, // API_DRIVER ANALOGUE (CUfilter_mode) {"cudaChannelFormatKind", {"hipChannelFormatKind", CONV_TEX, API_RUNTIME}}, {"cudaChannelFormatDesc", {"hipChannelFormatDesc", CONV_TEX, API_RUNTIME}}, // Texture Object Management - {"cudaResourceDesc", {"hipResourceDesc", CONV_TEX, API_RUNTIME}}, - {"cudaResourceViewDesc", {"hipResourceViewDesc", CONV_TEX, API_RUNTIME}}, - {"cudaTextureDesc", {"hipTextureDesc", CONV_TEX, API_RUNTIME}}, - {"surfaceReference", {"hipSurfaceReference", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaResourceDesc", {"hipResourceDesc", CONV_TEX, API_RUNTIME}}, + {"cudaResourceViewDesc", {"hipResourceViewDesc", CONV_TEX, API_RUNTIME}}, + {"cudaTextureDesc", {"hipTextureDesc", CONV_TEX, API_RUNTIME}}, + {"surfaceReference", {"hipSurfaceReference", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, // Left unchanged // {"textureReference", {"textureReference", CONV_TEX, API_RUNTIME}}, // typedefs - {"cudaTextureObject_t", {"hipTextureObject_t", CONV_TEX, API_RUNTIME}}, + {"cudaTextureObject_t", {"hipTextureObject_t", CONV_TEX, API_RUNTIME}}, // enums - {"cudaResourceType", {"hipResourceType", CONV_TEX, API_RUNTIME}}, // API_Driver ANALOGUE (CUresourcetype) - {"cudaResourceViewFormat", {"hipResourceViewFormat", CONV_TEX, API_RUNTIME}}, // API_Driver ANALOGUE (CUresourceViewFormat) - {"cudaTextureAddressMode", {"hipTextureAddressMode", CONV_TEX, API_RUNTIME}}, - {"cudaSurfaceBoundaryMode", {"hipSurfaceBoundaryMode", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaResourceType", + {"hipResourceType", CONV_TEX, API_RUNTIME}}, // API_Driver ANALOGUE (CUresourcetype) + {"cudaResourceViewFormat", + {"hipResourceViewFormat", CONV_TEX, + API_RUNTIME}}, // API_Driver ANALOGUE (CUresourceViewFormat) + {"cudaTextureAddressMode", {"hipTextureAddressMode", CONV_TEX, API_RUNTIME}}, + {"cudaSurfaceBoundaryMode", + {"hipSurfaceBoundaryMode", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, {"cudaSurfaceFormatMode", {"hipSurfaceFormatMode", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, // defines - {"cudaTextureType1D", {"hipTextureType1D", CONV_TEX, API_RUNTIME}}, - {"cudaTextureType2D", {"hipTextureType2D", CONV_TEX, API_RUNTIME}}, - {"cudaTextureType3D", {"hipTextureType3D", CONV_TEX, API_RUNTIME}}, - {"cudaTextureTypeCubemap", {"hipTextureTypeCubemap", CONV_TEX, API_RUNTIME}}, - {"cudaTextureType1DLayered", {"hipTextureType1DLayered", CONV_TEX, API_RUNTIME}}, - {"cudaTextureType2DLayered", {"hipTextureType2DLayered", CONV_TEX, API_RUNTIME}}, + {"cudaTextureType1D", {"hipTextureType1D", CONV_TEX, API_RUNTIME}}, + {"cudaTextureType2D", {"hipTextureType2D", CONV_TEX, API_RUNTIME}}, + {"cudaTextureType3D", {"hipTextureType3D", CONV_TEX, API_RUNTIME}}, + {"cudaTextureTypeCubemap", {"hipTextureTypeCubemap", CONV_TEX, API_RUNTIME}}, + {"cudaTextureType1DLayered", {"hipTextureType1DLayered", CONV_TEX, API_RUNTIME}}, + {"cudaTextureType2DLayered", {"hipTextureType2DLayered", CONV_TEX, API_RUNTIME}}, {"cudaTextureTypeCubemapLayered", {"hipTextureTypeCubemapLayered", CONV_TEX, API_RUNTIME}}, // Inter-Process Communication (IPC) - {"cudaIpcEventHandle_t", {"hipIpcEventHandle_t", CONV_TYPE, API_RUNTIME}}, + {"cudaIpcEventHandle_t", {"hipIpcEventHandle_t", CONV_TYPE, API_RUNTIME}}, {"cudaIpcEventHandle_st", {"hipIpcEventHandle_t", CONV_TYPE, API_RUNTIME}}, - {"cudaIpcMemHandle_t", {"hipIpcMemHandle_t", CONV_TYPE, API_RUNTIME}}, - {"cudaIpcMemHandle_st", {"hipIpcMemHandle_t", CONV_TYPE, API_RUNTIME}}, + {"cudaIpcMemHandle_t", {"hipIpcMemHandle_t", CONV_TYPE, API_RUNTIME}}, + {"cudaIpcMemHandle_st", {"hipIpcMemHandle_t", CONV_TYPE, API_RUNTIME}}, // Graphics Interoperability - {"cudaGraphicsCubeFace", {"hipGraphicsCubeFace", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGraphicsMapFlags", {"hipGraphicsMapFlags", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUgraphicsMapResourceFlags) - {"cudaGraphicsRegisterFlags", {"hipGraphicsRegisterFlags", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUgraphicsRegisterFlags) + {"cudaGraphicsCubeFace", {"hipGraphicsCubeFace", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGraphicsMapFlags", + {"hipGraphicsMapFlags", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUgraphicsMapResourceFlags) + {"cudaGraphicsRegisterFlags", + {"hipGraphicsRegisterFlags", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUgraphicsRegisterFlags) // OpenGL Interoperability - {"cudaGLDeviceList", {"hipGLDeviceList", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUGLDeviceList) - {"cudaGLMapFlags", {"hipGLMapFlags", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUGLmap_flags) + {"cudaGLDeviceList", + {"hipGLDeviceList", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUGLDeviceList) + {"cudaGLMapFlags", + {"hipGLMapFlags", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUGLmap_flags) // Direct3D 9 Interoperability - {"cudaD3D9DeviceList", {"hipD3D9DeviceList", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d9DeviceList) - {"cudaD3D9MapFlags", {"hipD3D9MapFlags", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d9map_flags) - {"cudaD3D9RegisterFlags", {"hipD3D9RegisterFlags", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d9Register_flags) + {"cudaD3D9DeviceList", + {"hipD3D9DeviceList", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d9DeviceList) + {"cudaD3D9MapFlags", + {"hipD3D9MapFlags", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d9map_flags) + {"cudaD3D9RegisterFlags", + {"hipD3D9RegisterFlags", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d9Register_flags) // Direct3D 10 Interoperability - {"cudaD3D10DeviceList", {"hipd3d10DeviceList", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d10DeviceList) - {"cudaD3D10MapFlags", {"hipD3D10MapFlags", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d10map_flags) - {"cudaD3D10RegisterFlags", {"hipD3D10RegisterFlags", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d10Register_flags) + {"cudaD3D10DeviceList", + {"hipd3d10DeviceList", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d10DeviceList) + {"cudaD3D10MapFlags", + {"hipD3D10MapFlags", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d10map_flags) + {"cudaD3D10RegisterFlags", + {"hipD3D10RegisterFlags", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d10Register_flags) // Direct3D 11 Interoperability - {"cudaD3D11DeviceList", {"hipd3d11DeviceList", CONV_D3D11, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d11DeviceList) + {"cudaD3D11DeviceList", + {"hipd3d11DeviceList", CONV_D3D11, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d11DeviceList) // EGL Interoperability - {"cudaEglStreamConnection", {"hipEglStreamConnection", CONV_EGL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUeglStreamConnection) + {"cudaEglStreamConnection", + {"hipEglStreamConnection", CONV_EGL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUeglStreamConnection) ///////////////////////////// cuBLAS ///////////////////////////// {"cublasHandle_t", {"hipblasHandle_t", CONV_TYPE, API_BLAS}}, // TODO: dereferencing: typedef struct cublasContext *cublasHandle_t; // {"cublasContext", {"hipblasHandle_t", CONV_TYPE, API_BLAS}}, - {"cublasOperation_t", {"hipblasOperation_t", CONV_TYPE, API_BLAS}}, - {"cublasStatus_t", {"hipblasStatus_t", CONV_TYPE, API_BLAS}}, - {"cublasFillMode_t", {"hipblasFillMode_t", CONV_TYPE, API_BLAS}}, - {"cublasDiagType_t", {"hipblasDiagType_t", CONV_TYPE, API_BLAS}}, - {"cublasSideMode_t", {"hipblasSideMode_t", CONV_TYPE, API_BLAS}}, + {"cublasOperation_t", {"hipblasOperation_t", CONV_TYPE, API_BLAS}}, + {"cublasStatus_t", {"hipblasStatus_t", CONV_TYPE, API_BLAS}}, + {"cublasFillMode_t", {"hipblasFillMode_t", CONV_TYPE, API_BLAS}}, + {"cublasDiagType_t", {"hipblasDiagType_t", CONV_TYPE, API_BLAS}}, + {"cublasSideMode_t", {"hipblasSideMode_t", CONV_TYPE, API_BLAS}}, {"cublasPointerMode_t", {"hipblasPointerMode_t", CONV_TYPE, API_BLAS}}, {"cublasAtomicsMode_t", {"hipblasAtomicsMode_t", CONV_TYPE, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDataType_t", {"hipblasDataType_t", CONV_TYPE, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDataType_t", {"hipblasDataType_t", CONV_TYPE, API_BLAS, HIP_UNSUPPORTED}}, ///////////////////////////// cuRAND ///////////////////////////// - {"curandStatus", {"hiprandStatus_t", CONV_TYPE, API_RAND}}, - {"curandStatus_t", {"hiprandStatus_t", CONV_TYPE, API_RAND}}, - {"curandRngType", {"hiprandRngType_t", CONV_TYPE, API_RAND}}, - {"curandRngType_t", {"hiprandRngType_t", CONV_TYPE, API_RAND}}, - {"curandGenerator_st", {"hiprandGenerator_st", CONV_TYPE, API_RAND}}, - {"curandGenerator_t", {"hiprandGenerator_t", CONV_TYPE, API_RAND}}, - {"curandDirectionVectorSet", {"hiprandDirectionVectorSet_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandDirectionVectorSet_t", {"hiprandDirectionVectorSet_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandOrdering", {"hiprandOrdering_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandOrdering_t", {"hiprandOrdering_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandDistribution_st", {"hiprandDistribution_st", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandHistogramM2V_st", {"hiprandDistribution_st", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandDistribution_t", {"hiprandDistribution_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandHistogramM2V_t", {"hiprandDistribution_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandDistributionShift_st", {"hiprandDistributionShift_st", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandDistributionShift_t", {"hiprandDistributionShift_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandDistributionM2Shift_st", {"hiprandDistributionM2Shift_st", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandDistributionM2Shift_t", {"hiprandDistributionM2Shift_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandHistogramM2_st", {"hiprandHistogramM2_st", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandHistogramM2_t", {"hiprandHistogramM2_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandHistogramM2K_st", {"hiprandHistogramM2K_st", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandHistogramM2K_t", {"hiprandHistogramM2K_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandStatus", {"hiprandStatus_t", CONV_TYPE, API_RAND}}, + {"curandStatus_t", {"hiprandStatus_t", CONV_TYPE, API_RAND}}, + {"curandRngType", {"hiprandRngType_t", CONV_TYPE, API_RAND}}, + {"curandRngType_t", {"hiprandRngType_t", CONV_TYPE, API_RAND}}, + {"curandGenerator_st", {"hiprandGenerator_st", CONV_TYPE, API_RAND}}, + {"curandGenerator_t", {"hiprandGenerator_t", CONV_TYPE, API_RAND}}, + {"curandDirectionVectorSet", + {"hiprandDirectionVectorSet_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandDirectionVectorSet_t", + {"hiprandDirectionVectorSet_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandOrdering", {"hiprandOrdering_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandOrdering_t", {"hiprandOrdering_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandDistribution_st", {"hiprandDistribution_st", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandHistogramM2V_st", {"hiprandDistribution_st", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandDistribution_t", {"hiprandDistribution_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandHistogramM2V_t", {"hiprandDistribution_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandDistributionShift_st", + {"hiprandDistributionShift_st", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandDistributionShift_t", + {"hiprandDistributionShift_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandDistributionM2Shift_st", + {"hiprandDistributionM2Shift_st", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandDistributionM2Shift_t", + {"hiprandDistributionM2Shift_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandHistogramM2_st", {"hiprandHistogramM2_st", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandHistogramM2_t", {"hiprandHistogramM2_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandHistogramM2K_st", {"hiprandHistogramM2K_st", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandHistogramM2K_t", {"hiprandHistogramM2K_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, {"curandDiscreteDistribution_st", {"hiprandDiscreteDistribution_st", CONV_TYPE, API_RAND}}, - {"curandDiscreteDistribution_t", {"hiprandDiscreteDistribution_t", CONV_TYPE, API_RAND}}, - {"curandMethod", {"hiprandMethod_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandMethod_t", {"hiprandMethod_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandDirectionVectors32_t", {"hiprandDirectionVectors32_t", CONV_TYPE, API_RAND}}, - {"curandDirectionVectors64_t", {"hiprandDirectionVectors64_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandDiscreteDistribution_t", {"hiprandDiscreteDistribution_t", CONV_TYPE, API_RAND}}, + {"curandMethod", {"hiprandMethod_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandMethod_t", {"hiprandMethod_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandDirectionVectors32_t", {"hiprandDirectionVectors32_t", CONV_TYPE, API_RAND}}, + {"curandDirectionVectors64_t", + {"hiprandDirectionVectors64_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, // cuRAND types for Device functions - {"curandStateMtgp32_t", {"hiprandStateMtgp32_t", CONV_TYPE, API_RAND}}, - {"curandStateScrambledSobol64_t", {"hiprandStateScrambledSobol64_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandStateSobol64_t", {"hiprandStateSobol64_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandStateScrambledSobol32_t", {"hiprandStateScrambledSobol32_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - {"curandStateSobol32_t", {"hiprandStateSobol32_t", CONV_TYPE, API_RAND}}, - {"curandStateMRG32k3a_t", {"hiprandStateMRG32k3a_t", CONV_TYPE, API_RAND}}, - {"curandStatePhilox4_32_10_t", {"hiprandStatePhilox4_32_10_t", CONV_TYPE, API_RAND}}, - {"curandStateXORWOW_t", {"hiprandStateXORWOW_t", CONV_TYPE, API_RAND}}, - {"curandState_t", {"hiprandState_t", CONV_TYPE, API_RAND}}, - {"curandState", {"hiprandState_t", CONV_TYPE, API_RAND}}, + {"curandStateMtgp32_t", {"hiprandStateMtgp32_t", CONV_TYPE, API_RAND}}, + {"curandStateScrambledSobol64_t", + {"hiprandStateScrambledSobol64_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandStateSobol64_t", {"hiprandStateSobol64_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandStateScrambledSobol32_t", + {"hiprandStateScrambledSobol32_t", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, + {"curandStateSobol32_t", {"hiprandStateSobol32_t", CONV_TYPE, API_RAND}}, + {"curandStateMRG32k3a_t", {"hiprandStateMRG32k3a_t", CONV_TYPE, API_RAND}}, + {"curandStatePhilox4_32_10_t", {"hiprandStatePhilox4_32_10_t", CONV_TYPE, API_RAND}}, + {"curandStateXORWOW_t", {"hiprandStateXORWOW_t", CONV_TYPE, API_RAND}}, + {"curandState_t", {"hiprandState_t", CONV_TYPE, API_RAND}}, + {"curandState", {"hiprandState_t", CONV_TYPE, API_RAND}}, }; /// Maps cuda header names to hip header names. -const std::map CUDA_INCLUDE_MAP{ +const std::map CUDA_INCLUDE_MAP{ // CUDA includes - {"cuda.h", {"hip/hip_runtime.h", CONV_INCLUDE_CUDA_MAIN_H, API_DRIVER}}, - {"cuda_runtime.h", {"hip/hip_runtime.h", CONV_INCLUDE_CUDA_MAIN_H, API_RUNTIME}}, - {"cuda_runtime_api.h", {"hip/hip_runtime_api.h", CONV_INCLUDE, API_RUNTIME}}, - {"channel_descriptor.h", {"hip/channel_descriptor.h", CONV_INCLUDE, API_RUNTIME}}, - {"device_functions.h", {"hip/device_functions.h", CONV_INCLUDE, API_RUNTIME}}, - {"driver_types.h", {"hip/driver_types.h", CONV_INCLUDE, API_RUNTIME}}, - {"cuComplex.h", {"hip/hip_complex.h", CONV_INCLUDE, API_RUNTIME}}, - {"cuda_fp16.h", {"hip/hip_fp16.h", CONV_INCLUDE, API_RUNTIME}}, - {"cuda_texture_types.h", {"hip/hip_texture_types.h", CONV_INCLUDE, API_RUNTIME}}, - {"vector_types.h", {"hip/hip_vector_types.h", CONV_INCLUDE, API_RUNTIME}}, + {"cuda.h", {"hip/hip_runtime.h", CONV_INCLUDE_CUDA_MAIN_H, API_DRIVER}}, + {"cuda_runtime.h", {"hip/hip_runtime.h", CONV_INCLUDE_CUDA_MAIN_H, API_RUNTIME}}, + {"cuda_runtime_api.h", {"hip/hip_runtime_api.h", CONV_INCLUDE, API_RUNTIME}}, + {"channel_descriptor.h", {"hip/channel_descriptor.h", CONV_INCLUDE, API_RUNTIME}}, + {"device_functions.h", {"hip/device_functions.h", CONV_INCLUDE, API_RUNTIME}}, + {"driver_types.h", {"hip/driver_types.h", CONV_INCLUDE, API_RUNTIME}}, + {"cuComplex.h", {"hip/hip_complex.h", CONV_INCLUDE, API_RUNTIME}}, + {"cuda_fp16.h", {"hip/hip_fp16.h", CONV_INCLUDE, API_RUNTIME}}, + {"cuda_texture_types.h", {"hip/hip_texture_types.h", CONV_INCLUDE, API_RUNTIME}}, + {"vector_types.h", {"hip/hip_vector_types.h", CONV_INCLUDE, API_RUNTIME}}, // CUBLAS includes - {"cublas.h", {"hipblas.h", CONV_INCLUDE_CUDA_MAIN_H, API_BLAS}}, - {"cublas_v2.h", {"hipblas.h", CONV_INCLUDE_CUDA_MAIN_H, API_BLAS}}, + {"cublas.h", {"hipblas.h", CONV_INCLUDE_CUDA_MAIN_H, API_BLAS}}, + {"cublas_v2.h", {"hipblas.h", CONV_INCLUDE_CUDA_MAIN_H, API_BLAS}}, // CURAND includes - {"curand.h", {"hiprand.h", CONV_INCLUDE_CUDA_MAIN_H, API_RAND}}, - {"curand_kernel.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_discrete.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_discrete2.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_globals.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_lognormal.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_mrg32k3a.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_mtgp32.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_mtgp32_host.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_mtgp32_kernel.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_mtgp32dc_p_11213.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_normal.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_normal_static.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_philox4x32_x.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_poisson.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_precalc.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, - {"curand_uniform.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand.h", {"hiprand.h", CONV_INCLUDE_CUDA_MAIN_H, API_RAND}}, + {"curand_kernel.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_discrete.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_discrete2.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_globals.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_lognormal.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_mrg32k3a.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_mtgp32.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_mtgp32_host.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_mtgp32_kernel.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_mtgp32dc_p_11213.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_normal.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_normal_static.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_philox4x32_x.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_poisson.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_precalc.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, + {"curand_uniform.h", {"hiprand_kernel.h", CONV_INCLUDE, API_RAND}}, // HIP includes // TODO: uncomment this when hip/cudacommon.h will be renamed to hip/hipcommon.h @@ -414,585 +545,1146 @@ const std::map CUDA_IDENTIFIER_MAP{ {"__CUDACC__", {"__HIPCC__", CONV_DEF, API_RUNTIME}}, // CUDA Driver API error codes only - {"CUDA_ERROR_INVALID_CONTEXT", {"hipErrorInvalidContext", CONV_TYPE, API_DRIVER}}, // 201 - {"CUDA_ERROR_CONTEXT_ALREADY_CURRENT", {"hipErrorContextAlreadyCurrent", CONV_TYPE, API_DRIVER}}, // 202 - {"CUDA_ERROR_ARRAY_IS_MAPPED", {"hipErrorArrayIsMapped", CONV_TYPE, API_DRIVER}}, // 207 - {"CUDA_ERROR_ALREADY_MAPPED", {"hipErrorAlreadyMapped", CONV_TYPE, API_DRIVER}}, // 208 - {"CUDA_ERROR_ALREADY_ACQUIRED", {"hipErrorAlreadyAcquired", CONV_TYPE, API_DRIVER}}, // 210 - {"CUDA_ERROR_NOT_MAPPED", {"hipErrorNotMapped", CONV_TYPE, API_DRIVER}}, // 211 - {"CUDA_ERROR_NOT_MAPPED_AS_ARRAY", {"hipErrorNotMappedAsArray", CONV_TYPE, API_DRIVER}}, // 212 - {"CUDA_ERROR_NOT_MAPPED_AS_POINTER", {"hipErrorNotMappedAsPointer", CONV_TYPE, API_DRIVER}}, // 213 - {"CUDA_ERROR_CONTEXT_ALREADY_IN_USE", {"hipErrorContextAlreadyInUse", CONV_TYPE, API_DRIVER}}, // 216 - {"CUDA_ERROR_INVALID_SOURCE", {"hipErrorInvalidSource", CONV_TYPE, API_DRIVER}}, // 300 - {"CUDA_ERROR_FILE_NOT_FOUND", {"hipErrorFileNotFound", CONV_TYPE, API_DRIVER}}, // 301 - {"CUDA_ERROR_NOT_FOUND", {"hipErrorNotFound", CONV_TYPE, API_DRIVER}}, // 500 - {"CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING", {"hipErrorLaunchIncompatibleTexturing", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 703 - {"CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE", {"hipErrorPrimaryContextActive", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 708 - {"CUDA_ERROR_CONTEXT_IS_DESTROYED", {"hipErrorContextIsDestroyed", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 709 - {"CUDA_ERROR_NOT_PERMITTED", {"hipErrorNotPermitted", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 800 - {"CUDA_ERROR_NOT_SUPPORTED", {"hipErrorNotSupported", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 801 + {"CUDA_ERROR_INVALID_CONTEXT", {"hipErrorInvalidContext", CONV_TYPE, API_DRIVER}}, // 201 + {"CUDA_ERROR_CONTEXT_ALREADY_CURRENT", + {"hipErrorContextAlreadyCurrent", CONV_TYPE, API_DRIVER}}, // 202 + {"CUDA_ERROR_ARRAY_IS_MAPPED", {"hipErrorArrayIsMapped", CONV_TYPE, API_DRIVER}}, // 207 + {"CUDA_ERROR_ALREADY_MAPPED", {"hipErrorAlreadyMapped", CONV_TYPE, API_DRIVER}}, // 208 + {"CUDA_ERROR_ALREADY_ACQUIRED", {"hipErrorAlreadyAcquired", CONV_TYPE, API_DRIVER}}, // 210 + {"CUDA_ERROR_NOT_MAPPED", {"hipErrorNotMapped", CONV_TYPE, API_DRIVER}}, // 211 + {"CUDA_ERROR_NOT_MAPPED_AS_ARRAY", {"hipErrorNotMappedAsArray", CONV_TYPE, API_DRIVER}}, // 212 + {"CUDA_ERROR_NOT_MAPPED_AS_POINTER", + {"hipErrorNotMappedAsPointer", CONV_TYPE, API_DRIVER}}, // 213 + {"CUDA_ERROR_CONTEXT_ALREADY_IN_USE", + {"hipErrorContextAlreadyInUse", CONV_TYPE, API_DRIVER}}, // 216 + {"CUDA_ERROR_INVALID_SOURCE", {"hipErrorInvalidSource", CONV_TYPE, API_DRIVER}}, // 300 + {"CUDA_ERROR_FILE_NOT_FOUND", {"hipErrorFileNotFound", CONV_TYPE, API_DRIVER}}, // 301 + {"CUDA_ERROR_NOT_FOUND", {"hipErrorNotFound", CONV_TYPE, API_DRIVER}}, // 500 + {"CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING", + {"hipErrorLaunchIncompatibleTexturing", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 703 + {"CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE", + {"hipErrorPrimaryContextActive", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 708 + {"CUDA_ERROR_CONTEXT_IS_DESTROYED", + {"hipErrorContextIsDestroyed", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 709 + {"CUDA_ERROR_NOT_PERMITTED", + {"hipErrorNotPermitted", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 800 + {"CUDA_ERROR_NOT_SUPPORTED", + {"hipErrorNotSupported", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 801 // CUDA RT API error code only - {"cudaErrorMissingConfiguration", {"hipErrorMissingConfiguration", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 - {"cudaErrorPriorLaunchFailure", {"hipErrorPriorLaunchFailure", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 5 - {"cudaErrorInvalidDeviceFunction", {"hipErrorInvalidDeviceFunction", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 8 - {"cudaErrorInvalidConfiguration", {"hipErrorInvalidConfiguration", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 9 - {"cudaErrorInvalidPitchValue", {"hipErrorInvalidPitchValue", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 12 - {"cudaErrorInvalidSymbol", {"hipErrorInvalidSymbol", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 13 - {"cudaErrorInvalidHostPointer", {"hipErrorInvalidHostPointer", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 16 - {"cudaErrorInvalidDevicePointer", {"hipErrorInvalidDevicePointer", CONV_TYPE, API_RUNTIME}}, // 17 - {"cudaErrorInvalidTexture", {"hipErrorInvalidTexture", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 18 - {"cudaErrorInvalidTextureBinding", {"hipErrorInvalidTextureBinding", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 19 - {"cudaErrorInvalidChannelDescriptor", {"hipErrorInvalidChannelDescriptor", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 20 - {"cudaErrorInvalidMemcpyDirection", {"hipErrorInvalidMemcpyDirection", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 21 - {"cudaErrorAddressOfConstant", {"hipErrorAddressOfConstant", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 22 - {"cudaErrorTextureFetchFailed", {"hipErrorTextureFetchFailed", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 23 - {"cudaErrorTextureNotBound", {"hipErrorTextureNotBound", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 24 - {"cudaErrorSynchronizationError", {"hipErrorSynchronizationError", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 25 - {"cudaErrorInvalidFilterSetting", {"hipErrorInvalidFilterSetting", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 26 - {"cudaErrorInvalidNormSetting", {"hipErrorInvalidNormSetting", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 27 - {"cudaErrorMixedDeviceExecution", {"hipErrorMixedDeviceExecution", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 28 + {"cudaErrorMissingConfiguration", + {"hipErrorMissingConfiguration", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 + {"cudaErrorPriorLaunchFailure", + {"hipErrorPriorLaunchFailure", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 5 + {"cudaErrorInvalidDeviceFunction", + {"hipErrorInvalidDeviceFunction", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 8 + {"cudaErrorInvalidConfiguration", + {"hipErrorInvalidConfiguration", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 9 + {"cudaErrorInvalidPitchValue", + {"hipErrorInvalidPitchValue", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 12 + {"cudaErrorInvalidSymbol", + {"hipErrorInvalidSymbol", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 13 + {"cudaErrorInvalidHostPointer", + {"hipErrorInvalidHostPointer", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 16 + {"cudaErrorInvalidDevicePointer", + {"hipErrorInvalidDevicePointer", CONV_TYPE, API_RUNTIME}}, // 17 + {"cudaErrorInvalidTexture", + {"hipErrorInvalidTexture", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 18 + {"cudaErrorInvalidTextureBinding", + {"hipErrorInvalidTextureBinding", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 19 + {"cudaErrorInvalidChannelDescriptor", + {"hipErrorInvalidChannelDescriptor", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 20 + {"cudaErrorInvalidMemcpyDirection", + {"hipErrorInvalidMemcpyDirection", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 21 + {"cudaErrorAddressOfConstant", + {"hipErrorAddressOfConstant", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 22 + {"cudaErrorTextureFetchFailed", + {"hipErrorTextureFetchFailed", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 23 + {"cudaErrorTextureNotBound", + {"hipErrorTextureNotBound", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 24 + {"cudaErrorSynchronizationError", + {"hipErrorSynchronizationError", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 25 + {"cudaErrorInvalidFilterSetting", + {"hipErrorInvalidFilterSetting", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 26 + {"cudaErrorInvalidNormSetting", + {"hipErrorInvalidNormSetting", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 27 + {"cudaErrorMixedDeviceExecution", + {"hipErrorMixedDeviceExecution", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 28 // Deprecated as of CUDA 4.1 - {"cudaErrorNotYetImplemented", {"hipErrorNotYetImplemented", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 31 + {"cudaErrorNotYetImplemented", + {"hipErrorNotYetImplemented", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 31 // Deprecated as of CUDA 3.1 - {"cudaErrorMemoryValueTooLarge", {"hipErrorMemoryValueTooLarge", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 32 - {"cudaErrorInsufficientDriver", {"hipErrorInsufficientDriver", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 35 - {"cudaErrorSetOnActiveProcess", {"hipErrorSetOnActiveProcess", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 36 - {"cudaErrorInvalidSurface", {"hipErrorInvalidSurface", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 37 - {"cudaErrorDuplicateVariableName", {"hipErrorDuplicateVariableName", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 43 - {"cudaErrorDuplicateTextureName", {"hipErrorDuplicateTextureName", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 44 - {"cudaErrorDuplicateSurfaceName", {"hipErrorDuplicateSurfaceName", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 45 - {"cudaErrorDevicesUnavailable", {"hipErrorDevicesUnavailable", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 46 - {"cudaErrorIncompatibleDriverContext", {"hipErrorIncompatibleDriverContext", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 49 - {"cudaErrorDeviceAlreadyInUse", {"hipErrorDeviceAlreadyInUse", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 54 - {"cudaErrorLaunchMaxDepthExceeded", {"hipErrorLaunchMaxDepthExceeded", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 65 - {"cudaErrorLaunchFileScopedTex", {"hipErrorLaunchFileScopedTex", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 66 - {"cudaErrorLaunchFileScopedSurf", {"hipErrorLaunchFileScopedSurf", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 67 - {"cudaErrorSyncDepthExceeded", {"hipErrorSyncDepthExceeded", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 68 - {"cudaErrorLaunchPendingCountExceeded", {"hipErrorLaunchPendingCountExceeded", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 69 - {"cudaErrorNotPermitted", {"hipErrorNotPermitted", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 70 - {"cudaErrorNotSupported", {"hipErrorNotSupported", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 71 - {"cudaErrorStartupFailure", {"hipErrorStartupFailure", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x7f + {"cudaErrorMemoryValueTooLarge", + {"hipErrorMemoryValueTooLarge", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 32 + {"cudaErrorInsufficientDriver", + {"hipErrorInsufficientDriver", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 35 + {"cudaErrorSetOnActiveProcess", + {"hipErrorSetOnActiveProcess", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 36 + {"cudaErrorInvalidSurface", + {"hipErrorInvalidSurface", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 37 + {"cudaErrorDuplicateVariableName", + {"hipErrorDuplicateVariableName", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 43 + {"cudaErrorDuplicateTextureName", + {"hipErrorDuplicateTextureName", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 44 + {"cudaErrorDuplicateSurfaceName", + {"hipErrorDuplicateSurfaceName", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 45 + {"cudaErrorDevicesUnavailable", + {"hipErrorDevicesUnavailable", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 46 + {"cudaErrorIncompatibleDriverContext", + {"hipErrorIncompatibleDriverContext", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 49 + {"cudaErrorDeviceAlreadyInUse", + {"hipErrorDeviceAlreadyInUse", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 54 + {"cudaErrorLaunchMaxDepthExceeded", + {"hipErrorLaunchMaxDepthExceeded", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 65 + {"cudaErrorLaunchFileScopedTex", + {"hipErrorLaunchFileScopedTex", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 66 + {"cudaErrorLaunchFileScopedSurf", + {"hipErrorLaunchFileScopedSurf", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 67 + {"cudaErrorSyncDepthExceeded", + {"hipErrorSyncDepthExceeded", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 68 + {"cudaErrorLaunchPendingCountExceeded", + {"hipErrorLaunchPendingCountExceeded", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 69 + {"cudaErrorNotPermitted", + {"hipErrorNotPermitted", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 70 + {"cudaErrorNotSupported", + {"hipErrorNotSupported", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 71 + {"cudaErrorStartupFailure", + {"hipErrorStartupFailure", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x7f // Deprecated as of CUDA 4.1 - {"cudaErrorApiFailureBase", {"hipErrorApiFailureBase", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 10000 + {"cudaErrorApiFailureBase", + {"hipErrorApiFailureBase", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 10000 - {"CUDA_SUCCESS", {"hipSuccess", CONV_TYPE, API_DRIVER}}, // 0 - {"cudaSuccess", {"hipSuccess", CONV_TYPE, API_RUNTIME}}, // 0 + {"CUDA_SUCCESS", {"hipSuccess", CONV_TYPE, API_DRIVER}}, // 0 + {"cudaSuccess", {"hipSuccess", CONV_TYPE, API_RUNTIME}}, // 0 - {"CUDA_ERROR_INVALID_VALUE", {"hipErrorInvalidValue", CONV_TYPE, API_DRIVER}}, // 1 - {"cudaErrorInvalidValue", {"hipErrorInvalidValue", CONV_TYPE, API_RUNTIME}}, // 11 + {"CUDA_ERROR_INVALID_VALUE", {"hipErrorInvalidValue", CONV_TYPE, API_DRIVER}}, // 1 + {"cudaErrorInvalidValue", {"hipErrorInvalidValue", CONV_TYPE, API_RUNTIME}}, // 11 - {"CUDA_ERROR_OUT_OF_MEMORY", {"hipErrorMemoryAllocation", CONV_TYPE, API_DRIVER}}, // 2 - {"cudaErrorMemoryAllocation", {"hipErrorMemoryAllocation", CONV_TYPE, API_RUNTIME}}, // 2 + {"CUDA_ERROR_OUT_OF_MEMORY", {"hipErrorMemoryAllocation", CONV_TYPE, API_DRIVER}}, // 2 + {"cudaErrorMemoryAllocation", {"hipErrorMemoryAllocation", CONV_TYPE, API_RUNTIME}}, // 2 - {"CUDA_ERROR_NOT_INITIALIZED", {"hipErrorNotInitialized", CONV_TYPE, API_DRIVER}}, // 3 - {"cudaErrorInitializationError", {"hipErrorInitializationError", CONV_TYPE, API_RUNTIME}}, // 3 + {"CUDA_ERROR_NOT_INITIALIZED", {"hipErrorNotInitialized", CONV_TYPE, API_DRIVER}}, // 3 + {"cudaErrorInitializationError", {"hipErrorInitializationError", CONV_TYPE, API_RUNTIME}}, // 3 - {"CUDA_ERROR_DEINITIALIZED", {"hipErrorDeinitialized", CONV_TYPE, API_DRIVER}}, // 4 + {"CUDA_ERROR_DEINITIALIZED", {"hipErrorDeinitialized", CONV_TYPE, API_DRIVER}}, // 4 // TODO: double check, that these errors match - {"cudaErrorCudartUnloading", {"hipErrorDeinitialized", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 29 + {"cudaErrorCudartUnloading", + {"hipErrorDeinitialized", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 29 - {"CUDA_ERROR_PROFILER_DISABLED", {"hipErrorProfilerDisabled", CONV_TYPE, API_DRIVER}}, // 5 - {"cudaErrorProfilerDisabled", {"hipErrorProfilerDisabled", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 55 + {"CUDA_ERROR_PROFILER_DISABLED", {"hipErrorProfilerDisabled", CONV_TYPE, API_DRIVER}}, // 5 + {"cudaErrorProfilerDisabled", + {"hipErrorProfilerDisabled", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 55 - {"CUDA_ERROR_PROFILER_NOT_INITIALIZED", {"hipErrorProfilerNotInitialized", CONV_TYPE, API_DRIVER}}, // 6 + {"CUDA_ERROR_PROFILER_NOT_INITIALIZED", + {"hipErrorProfilerNotInitialized", CONV_TYPE, API_DRIVER}}, // 6 // Deprecated as of CUDA 5.0 - {"cudaErrorProfilerNotInitialized", {"hipErrorProfilerNotInitialized", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 56 + {"cudaErrorProfilerNotInitialized", + {"hipErrorProfilerNotInitialized", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 56 - {"CUDA_ERROR_PROFILER_ALREADY_STARTED", {"hipErrorProfilerAlreadyStarted", CONV_TYPE, API_DRIVER}}, // 7 + {"CUDA_ERROR_PROFILER_ALREADY_STARTED", + {"hipErrorProfilerAlreadyStarted", CONV_TYPE, API_DRIVER}}, // 7 // Deprecated as of CUDA 5.0 - {"cudaErrorProfilerAlreadyStarted", {"hipErrorProfilerAlreadyStarted", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 57 + {"cudaErrorProfilerAlreadyStarted", + {"hipErrorProfilerAlreadyStarted", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 57 - {"CUDA_ERROR_PROFILER_ALREADY_STOPPED", {"hipErrorProfilerAlreadyStopped", CONV_TYPE, API_DRIVER}}, // 8 + {"CUDA_ERROR_PROFILER_ALREADY_STOPPED", + {"hipErrorProfilerAlreadyStopped", CONV_TYPE, API_DRIVER}}, // 8 // Deprecated as of CUDA 5.0 - {"cudaErrorProfilerAlreadyStopped", {"hipErrorProfilerAlreadyStopped", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 58 + {"cudaErrorProfilerAlreadyStopped", + {"hipErrorProfilerAlreadyStopped", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 58 - {"CUDA_ERROR_NO_DEVICE", {"hipErrorNoDevice", CONV_TYPE, API_DRIVER}}, // 100 - {"cudaErrorNoDevice", {"hipErrorNoDevice", CONV_TYPE, API_RUNTIME}}, // 38 + {"CUDA_ERROR_NO_DEVICE", {"hipErrorNoDevice", CONV_TYPE, API_DRIVER}}, // 100 + {"cudaErrorNoDevice", {"hipErrorNoDevice", CONV_TYPE, API_RUNTIME}}, // 38 - {"CUDA_ERROR_INVALID_DEVICE", {"hipErrorInvalidDevice", CONV_TYPE, API_DRIVER}}, // 101 - {"cudaErrorInvalidDevice", {"hipErrorInvalidDevice", CONV_TYPE, API_RUNTIME}}, // 10 + {"CUDA_ERROR_INVALID_DEVICE", {"hipErrorInvalidDevice", CONV_TYPE, API_DRIVER}}, // 101 + {"cudaErrorInvalidDevice", {"hipErrorInvalidDevice", CONV_TYPE, API_RUNTIME}}, // 10 - {"CUDA_ERROR_INVALID_IMAGE", {"hipErrorInvalidImage", CONV_TYPE, API_DRIVER}}, // 200 - {"cudaErrorInvalidKernelImage", {"hipErrorInvalidImage", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 47 + {"CUDA_ERROR_INVALID_IMAGE", {"hipErrorInvalidImage", CONV_TYPE, API_DRIVER}}, // 200 + {"cudaErrorInvalidKernelImage", + {"hipErrorInvalidImage", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 47 - {"CUDA_ERROR_MAP_FAILED", {"hipErrorMapFailed", CONV_TYPE, API_DRIVER}}, // 205 + {"CUDA_ERROR_MAP_FAILED", {"hipErrorMapFailed", CONV_TYPE, API_DRIVER}}, // 205 // TODO: double check, that these errors match - {"cudaErrorMapBufferObjectFailed", {"hipErrorMapFailed", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 14 + {"cudaErrorMapBufferObjectFailed", + {"hipErrorMapFailed", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 14 - {"CUDA_ERROR_UNMAP_FAILED", {"hipErrorUnmapFailed", CONV_TYPE, API_DRIVER}}, // 206 + {"CUDA_ERROR_UNMAP_FAILED", {"hipErrorUnmapFailed", CONV_TYPE, API_DRIVER}}, // 206 // TODO: double check, that these errors match - {"cudaErrorUnmapBufferObjectFailed", {"hipErrorUnmapFailed", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 15 + {"cudaErrorUnmapBufferObjectFailed", + {"hipErrorUnmapFailed", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 15 - {"CUDA_ERROR_NO_BINARY_FOR_GPU", {"hipErrorNoBinaryForGpu", CONV_TYPE, API_DRIVER}}, // 209 - {"cudaErrorNoKernelImageForDevice", {"hipErrorNoBinaryForGpu", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 48 + {"CUDA_ERROR_NO_BINARY_FOR_GPU", {"hipErrorNoBinaryForGpu", CONV_TYPE, API_DRIVER}}, // 209 + {"cudaErrorNoKernelImageForDevice", + {"hipErrorNoBinaryForGpu", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 48 - {"CUDA_ERROR_ECC_UNCORRECTABLE", {"hipErrorECCNotCorrectable", CONV_TYPE, API_DRIVER}}, // 214 - {"cudaErrorECCUncorrectable", {"hipErrorECCNotCorrectable", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 39 + {"CUDA_ERROR_ECC_UNCORRECTABLE", {"hipErrorECCNotCorrectable", CONV_TYPE, API_DRIVER}}, // 214 + {"cudaErrorECCUncorrectable", + {"hipErrorECCNotCorrectable", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 39 - {"CUDA_ERROR_UNSUPPORTED_LIMIT", {"hipErrorUnsupportedLimit", CONV_TYPE, API_DRIVER}}, // 215 - {"cudaErrorUnsupportedLimit", {"hipErrorUnsupportedLimit", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 42 + {"CUDA_ERROR_UNSUPPORTED_LIMIT", {"hipErrorUnsupportedLimit", CONV_TYPE, API_DRIVER}}, // 215 + {"cudaErrorUnsupportedLimit", + {"hipErrorUnsupportedLimit", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 42 - {"CUDA_ERROR_PEER_ACCESS_UNSUPPORTED", {"hipErrorPeerAccessUnsupported", CONV_TYPE, API_DRIVER}}, // 217 - {"cudaErrorPeerAccessUnsupported", {"hipErrorPeerAccessUnsupported", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 64 + {"CUDA_ERROR_PEER_ACCESS_UNSUPPORTED", + {"hipErrorPeerAccessUnsupported", CONV_TYPE, API_DRIVER}}, // 217 + {"cudaErrorPeerAccessUnsupported", + {"hipErrorPeerAccessUnsupported", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 64 - {"CUDA_ERROR_INVALID_PTX", {"hipErrorInvalidKernelFile", CONV_TYPE, API_DRIVER}}, // 218 - {"cudaErrorInvalidPtx", {"hipErrorInvalidKernelFile", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 78 + {"CUDA_ERROR_INVALID_PTX", {"hipErrorInvalidKernelFile", CONV_TYPE, API_DRIVER}}, // 218 + {"cudaErrorInvalidPtx", + {"hipErrorInvalidKernelFile", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 78 - {"CUDA_ERROR_INVALID_GRAPHICS_CONTEXT", {"hipErrorInvalidGraphicsContext", CONV_TYPE, API_DRIVER}}, // 219 - {"cudaErrorInvalidGraphicsContext", {"hipErrorInvalidGraphicsContext", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 79 + {"CUDA_ERROR_INVALID_GRAPHICS_CONTEXT", + {"hipErrorInvalidGraphicsContext", CONV_TYPE, API_DRIVER}}, // 219 + {"cudaErrorInvalidGraphicsContext", + {"hipErrorInvalidGraphicsContext", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 79 - {"CUDA_ERROR_NVLINK_UNCORRECTABLE", {"hipErrorNvlinkUncorrectable", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 220 - {"cudaErrorNvlinkUncorrectable", {"hipErrorNvlinkUncorrectable", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 80 + {"CUDA_ERROR_NVLINK_UNCORRECTABLE", + {"hipErrorNvlinkUncorrectable", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 220 + {"cudaErrorNvlinkUncorrectable", + {"hipErrorNvlinkUncorrectable", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 80 - {"CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND", {"hipErrorSharedObjectSymbolNotFound", CONV_TYPE, API_DRIVER}}, // 302 - {"cudaErrorSharedObjectSymbolNotFound", {"hipErrorSharedObjectSymbolNotFound", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 40 + {"CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND", + {"hipErrorSharedObjectSymbolNotFound", CONV_TYPE, API_DRIVER}}, // 302 + {"cudaErrorSharedObjectSymbolNotFound", + {"hipErrorSharedObjectSymbolNotFound", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 40 - {"CUDA_ERROR_SHARED_OBJECT_INIT_FAILED", {"hipErrorSharedObjectInitFailed", CONV_TYPE, API_DRIVER}}, // 303 - {"cudaErrorSharedObjectInitFailed", {"hipErrorSharedObjectInitFailed", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 41 + {"CUDA_ERROR_SHARED_OBJECT_INIT_FAILED", + {"hipErrorSharedObjectInitFailed", CONV_TYPE, API_DRIVER}}, // 303 + {"cudaErrorSharedObjectInitFailed", + {"hipErrorSharedObjectInitFailed", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 41 - {"CUDA_ERROR_OPERATING_SYSTEM", {"hipErrorOperatingSystem", CONV_TYPE, API_DRIVER}}, // 304 - {"cudaErrorOperatingSystem", {"hipErrorOperatingSystem", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 63 + {"CUDA_ERROR_OPERATING_SYSTEM", {"hipErrorOperatingSystem", CONV_TYPE, API_DRIVER}}, // 304 + {"cudaErrorOperatingSystem", + {"hipErrorOperatingSystem", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 63 - {"CUDA_ERROR_INVALID_HANDLE", {"hipErrorInvalidResourceHandle", CONV_TYPE, API_DRIVER}}, // 400 - {"cudaErrorInvalidResourceHandle", {"hipErrorInvalidResourceHandle", CONV_TYPE, API_RUNTIME}}, // 33 + {"CUDA_ERROR_INVALID_HANDLE", {"hipErrorInvalidResourceHandle", CONV_TYPE, API_DRIVER}}, // 400 + {"cudaErrorInvalidResourceHandle", + {"hipErrorInvalidResourceHandle", CONV_TYPE, API_RUNTIME}}, // 33 - {"CUDA_ERROR_NOT_READY", {"hipErrorNotReady", CONV_TYPE, API_DRIVER}}, // 600 - {"cudaErrorNotReady", {"hipErrorNotReady", CONV_TYPE, API_RUNTIME}}, // 34 + {"CUDA_ERROR_NOT_READY", {"hipErrorNotReady", CONV_TYPE, API_DRIVER}}, // 600 + {"cudaErrorNotReady", {"hipErrorNotReady", CONV_TYPE, API_RUNTIME}}, // 34 - {"CUDA_ERROR_ILLEGAL_ADDRESS", {"hipErrorIllegalAddress", CONV_TYPE, API_DRIVER}}, // 700 - {"cudaErrorIllegalAddress", {"hipErrorIllegalAddress", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 77 + {"CUDA_ERROR_ILLEGAL_ADDRESS", {"hipErrorIllegalAddress", CONV_TYPE, API_DRIVER}}, // 700 + {"cudaErrorIllegalAddress", + {"hipErrorIllegalAddress", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 77 - {"CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES", {"hipErrorLaunchOutOfResources", CONV_TYPE, API_DRIVER}}, // 701 - {"cudaErrorLaunchOutOfResources", {"hipErrorLaunchOutOfResources", CONV_TYPE, API_RUNTIME}}, // 7 + {"CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES", + {"hipErrorLaunchOutOfResources", CONV_TYPE, API_DRIVER}}, // 701 + {"cudaErrorLaunchOutOfResources", + {"hipErrorLaunchOutOfResources", CONV_TYPE, API_RUNTIME}}, // 7 - {"CUDA_ERROR_LAUNCH_TIMEOUT", {"hipErrorLaunchTimeOut", CONV_TYPE, API_DRIVER}}, // 702 - {"cudaErrorLaunchTimeout", {"hipErrorLaunchTimeOut", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 6 + {"CUDA_ERROR_LAUNCH_TIMEOUT", {"hipErrorLaunchTimeOut", CONV_TYPE, API_DRIVER}}, // 702 + {"cudaErrorLaunchTimeout", + {"hipErrorLaunchTimeOut", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 6 - {"CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED", {"hipErrorPeerAccessAlreadyEnabled", CONV_TYPE, API_DRIVER}}, // 704 - {"cudaErrorPeerAccessAlreadyEnabled", {"hipErrorPeerAccessAlreadyEnabled", CONV_TYPE, API_RUNTIME}}, // 50 + {"CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED", + {"hipErrorPeerAccessAlreadyEnabled", CONV_TYPE, API_DRIVER}}, // 704 + {"cudaErrorPeerAccessAlreadyEnabled", + {"hipErrorPeerAccessAlreadyEnabled", CONV_TYPE, API_RUNTIME}}, // 50 - {"CUDA_ERROR_PEER_ACCESS_NOT_ENABLED", {"hipErrorPeerAccessNotEnabled", CONV_TYPE, API_DRIVER}}, // 705 - {"cudaErrorPeerAccessNotEnabled", {"hipErrorPeerAccessNotEnabled", CONV_TYPE, API_RUNTIME}}, // 51 + {"CUDA_ERROR_PEER_ACCESS_NOT_ENABLED", + {"hipErrorPeerAccessNotEnabled", CONV_TYPE, API_DRIVER}}, // 705 + {"cudaErrorPeerAccessNotEnabled", + {"hipErrorPeerAccessNotEnabled", CONV_TYPE, API_RUNTIME}}, // 51 - {"CUDA_ERROR_ASSERT", {"hipErrorAssert", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 710 - {"cudaErrorAssert", {"hipErrorAssert", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 59 + {"CUDA_ERROR_ASSERT", {"hipErrorAssert", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 710 + {"cudaErrorAssert", {"hipErrorAssert", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 59 - {"CUDA_ERROR_TOO_MANY_PEERS", {"hipErrorTooManyPeers", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 711 - {"cudaErrorTooManyPeers", {"hipErrorTooManyPeers", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 60 + {"CUDA_ERROR_TOO_MANY_PEERS", + {"hipErrorTooManyPeers", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 711 + {"cudaErrorTooManyPeers", + {"hipErrorTooManyPeers", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 60 - {"CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED", {"hipErrorHostMemoryAlreadyRegistered", CONV_TYPE, API_DRIVER}}, // 712 - {"cudaErrorHostMemoryAlreadyRegistered", {"hipErrorHostMemoryAlreadyRegistered", CONV_TYPE, API_RUNTIME}}, // 61 + {"CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED", + {"hipErrorHostMemoryAlreadyRegistered", CONV_TYPE, API_DRIVER}}, // 712 + {"cudaErrorHostMemoryAlreadyRegistered", + {"hipErrorHostMemoryAlreadyRegistered", CONV_TYPE, API_RUNTIME}}, // 61 - {"CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED", {"hipErrorHostMemoryNotRegistered", CONV_TYPE, API_DRIVER}}, // 713 - {"cudaErrorHostMemoryNotRegistered", {"hipErrorHostMemoryNotRegistered", CONV_TYPE, API_RUNTIME}}, // 62 + {"CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED", + {"hipErrorHostMemoryNotRegistered", CONV_TYPE, API_DRIVER}}, // 713 + {"cudaErrorHostMemoryNotRegistered", + {"hipErrorHostMemoryNotRegistered", CONV_TYPE, API_RUNTIME}}, // 62 - {"CUDA_ERROR_HARDWARE_STACK_ERROR", {"hipErrorHardwareStackError", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 714 - {"cudaErrorHardwareStackError", {"hipErrorHardwareStackError", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 72 + {"CUDA_ERROR_HARDWARE_STACK_ERROR", + {"hipErrorHardwareStackError", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 714 + {"cudaErrorHardwareStackError", + {"hipErrorHardwareStackError", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 72 - {"CUDA_ERROR_ILLEGAL_INSTRUCTION", {"hipErrorIllegalInstruction", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 715 - {"cudaErrorIllegalInstruction", {"hipErrorIllegalInstruction", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 73 + {"CUDA_ERROR_ILLEGAL_INSTRUCTION", + {"hipErrorIllegalInstruction", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 715 + {"cudaErrorIllegalInstruction", + {"hipErrorIllegalInstruction", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 73 - {"CUDA_ERROR_MISALIGNED_ADDRESS", {"hipErrorMisalignedAddress", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 716 - {"cudaErrorMisalignedAddress", {"hipErrorMisalignedAddress", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 74 + {"CUDA_ERROR_MISALIGNED_ADDRESS", + {"hipErrorMisalignedAddress", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 716 + {"cudaErrorMisalignedAddress", + {"hipErrorMisalignedAddress", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 74 - {"CUDA_ERROR_INVALID_ADDRESS_SPACE", {"hipErrorInvalidAddressSpace", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 717 - {"cudaErrorInvalidAddressSpace", {"hipErrorInvalidAddressSpace", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 75 + {"CUDA_ERROR_INVALID_ADDRESS_SPACE", + {"hipErrorInvalidAddressSpace", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 717 + {"cudaErrorInvalidAddressSpace", + {"hipErrorInvalidAddressSpace", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 75 - {"CUDA_ERROR_INVALID_PC", {"hipErrorInvalidPc", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 718 - {"cudaErrorInvalidPc", {"hipErrorInvalidPc", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 76 + {"CUDA_ERROR_INVALID_PC", + {"hipErrorInvalidPc", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 718 + {"cudaErrorInvalidPc", {"hipErrorInvalidPc", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 76 - {"CUDA_ERROR_LAUNCH_FAILED", {"hipErrorLaunchFailure", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 719 - {"cudaErrorLaunchFailure", {"hipErrorLaunchFailure", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 4 + {"CUDA_ERROR_LAUNCH_FAILED", + {"hipErrorLaunchFailure", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 719 + {"cudaErrorLaunchFailure", + {"hipErrorLaunchFailure", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 4 - {"CUDA_ERROR_UNKNOWN", {"hipErrorUnknown", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 999 - {"cudaErrorUnknown", {"hipErrorUnknown", CONV_TYPE, API_RUNTIME}}, // 30 + {"CUDA_ERROR_UNKNOWN", {"hipErrorUnknown", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 999 + {"cudaErrorUnknown", {"hipErrorUnknown", CONV_TYPE, API_RUNTIME}}, // 30 ///////////////////////////// CUDA DRIVER API ///////////////////////////// // CUaddress_mode enum - {"CU_TR_ADDRESS_MODE_WRAP", {"HIP_TR_ADDRESS_MODE_WRAP", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0 - {"CU_TR_ADDRESS_MODE_CLAMP", {"HIP_TR_ADDRESS_MODE_CLAMP", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 1 - {"CU_TR_ADDRESS_MODE_MIRROR", {"HIP_TR_ADDRESS_MODE_MIRROR", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 2 - {"CU_TR_ADDRESS_MODE_BORDER", {"HIP_TR_ADDRESS_MODE_BORDER", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 3 + {"CU_TR_ADDRESS_MODE_WRAP", + {"HIP_TR_ADDRESS_MODE_WRAP", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0 + {"CU_TR_ADDRESS_MODE_CLAMP", + {"HIP_TR_ADDRESS_MODE_CLAMP", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 1 + {"CU_TR_ADDRESS_MODE_MIRROR", + {"HIP_TR_ADDRESS_MODE_MIRROR", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 2 + {"CU_TR_ADDRESS_MODE_BORDER", + {"HIP_TR_ADDRESS_MODE_BORDER", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 3 // CUarray_cubemap_face enum - {"CU_CUBEMAP_FACE_POSITIVE_X", {"HIP_CUBEMAP_FACE_POSITIVE_X", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 - {"CU_CUBEMAP_FACE_NEGATIVE_X", {"HIP_CUBEMAP_FACE_NEGATIVE_X", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 - {"CU_CUBEMAP_FACE_POSITIVE_Y", {"HIP_CUBEMAP_FACE_POSITIVE_Y", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 - {"CU_CUBEMAP_FACE_NEGATIVE_Y", {"HIP_CUBEMAP_FACE_NEGATIVE_Y", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x03 - {"CU_CUBEMAP_FACE_POSITIVE_Z", {"HIP_CUBEMAP_FACE_POSITIVE_Z", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 - {"CU_CUBEMAP_FACE_NEGATIVE_Z", {"HIP_CUBEMAP_FACE_NEGATIVE_Z", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x05 + {"CU_CUBEMAP_FACE_POSITIVE_X", + {"HIP_CUBEMAP_FACE_POSITIVE_X", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 + {"CU_CUBEMAP_FACE_NEGATIVE_X", + {"HIP_CUBEMAP_FACE_NEGATIVE_X", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 + {"CU_CUBEMAP_FACE_POSITIVE_Y", + {"HIP_CUBEMAP_FACE_POSITIVE_Y", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 + {"CU_CUBEMAP_FACE_NEGATIVE_Y", + {"HIP_CUBEMAP_FACE_NEGATIVE_Y", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x03 + {"CU_CUBEMAP_FACE_POSITIVE_Z", + {"HIP_CUBEMAP_FACE_POSITIVE_Z", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 + {"CU_CUBEMAP_FACE_NEGATIVE_Z", + {"HIP_CUBEMAP_FACE_NEGATIVE_Z", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x05 // CUarray_format enum - {"CU_AD_FORMAT_UNSIGNED_INT8", {"HIP_AD_FORMAT_UNSIGNED_INT8", CONV_TYPE, API_DRIVER}}, // 0x01 - {"CU_AD_FORMAT_UNSIGNED_INT16", {"HIP_AD_FORMAT_UNSIGNED_INT16", CONV_TYPE, API_DRIVER}}, // 0x02 - {"CU_AD_FORMAT_UNSIGNED_INT32", {"HIP_AD_FORMAT_UNSIGNED_INT32", CONV_TYPE, API_DRIVER}}, // 0x03 - {"CU_AD_FORMAT_SIGNED_INT8", {"HIP_AD_FORMAT_SIGNED_INT8", CONV_TYPE, API_DRIVER}}, // 0x08 - {"CU_AD_FORMAT_SIGNED_INT16", {"HIP_AD_FORMAT_SIGNED_INT16", CONV_TYPE, API_DRIVER}}, // 0x09 - {"CU_AD_FORMAT_SIGNED_INT32", {"HIP_AD_FORMAT_SIGNED_INT32", CONV_TYPE, API_DRIVER}}, // 0x0a - {"CU_AD_FORMAT_HALF", {"HIP_AD_FORMAT_HALF", CONV_TYPE, API_DRIVER}}, // 0x10 - {"CU_AD_FORMAT_FLOAT", {"HIP_AD_FORMAT_FLOAT", CONV_TYPE, API_DRIVER}}, // 0x20 + {"CU_AD_FORMAT_UNSIGNED_INT8", {"HIP_AD_FORMAT_UNSIGNED_INT8", CONV_TYPE, API_DRIVER}}, // 0x01 + {"CU_AD_FORMAT_UNSIGNED_INT16", + {"HIP_AD_FORMAT_UNSIGNED_INT16", CONV_TYPE, API_DRIVER}}, // 0x02 + {"CU_AD_FORMAT_UNSIGNED_INT32", + {"HIP_AD_FORMAT_UNSIGNED_INT32", CONV_TYPE, API_DRIVER}}, // 0x03 + {"CU_AD_FORMAT_SIGNED_INT8", {"HIP_AD_FORMAT_SIGNED_INT8", CONV_TYPE, API_DRIVER}}, // 0x08 + {"CU_AD_FORMAT_SIGNED_INT16", {"HIP_AD_FORMAT_SIGNED_INT16", CONV_TYPE, API_DRIVER}}, // 0x09 + {"CU_AD_FORMAT_SIGNED_INT32", {"HIP_AD_FORMAT_SIGNED_INT32", CONV_TYPE, API_DRIVER}}, // 0x0a + {"CU_AD_FORMAT_HALF", {"HIP_AD_FORMAT_HALF", CONV_TYPE, API_DRIVER}}, // 0x10 + {"CU_AD_FORMAT_FLOAT", {"HIP_AD_FORMAT_FLOAT", CONV_TYPE, API_DRIVER}}, // 0x20 // CUcomputemode enum - {"CU_COMPUTEMODE_DEFAULT", {"hipComputeModeDefault", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0 // API_RUNTIME ANALOGUE (cudaComputeModeDefault = 0) - {"CU_COMPUTEMODE_EXCLUSIVE", {"hipComputeModeExclusive", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 1 // API_RUNTIME ANALOGUE (cudaComputeModeExclusive = 1) - {"CU_COMPUTEMODE_PROHIBITED", {"hipComputeModeProhibited", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 2 // API_RUNTIME ANALOGUE (cudaComputeModeProhibited = 2) - {"CU_COMPUTEMODE_EXCLUSIVE_PROCESS", {"hipComputeModeExclusiveProcess", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 3 // API_RUNTIME ANALOGUE (cudaComputeModeExclusiveProcess = 3) + {"CU_COMPUTEMODE_DEFAULT", + {"hipComputeModeDefault", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0 // API_RUNTIME ANALOGUE (cudaComputeModeDefault = 0) + {"CU_COMPUTEMODE_EXCLUSIVE", + {"hipComputeModeExclusive", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 1 // API_RUNTIME ANALOGUE (cudaComputeModeExclusive = 1) + {"CU_COMPUTEMODE_PROHIBITED", + {"hipComputeModeProhibited", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 2 // API_RUNTIME ANALOGUE (cudaComputeModeProhibited = 2) + {"CU_COMPUTEMODE_EXCLUSIVE_PROCESS", + {"hipComputeModeExclusiveProcess", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 3 // API_RUNTIME ANALOGUE (cudaComputeModeExclusiveProcess = 3) // Memory advise values // {"CUmem_advise_enum", {"hipMemAdvise", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_MEM_ADVISE_SET_READ_MOSTLY", {"hipMemAdviseSetReadMostly", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 1 // API_RUNTIME ANALOGUE (cudaMemAdviseSetReadMostly = 1) - {"CU_MEM_ADVISE_UNSET_READ_MOSTLY", {"hipMemAdviseUnsetReadMostly", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 2 // API_RUNTIME ANALOGUE (cudaMemAdviseUnsetReadMostly = 2) - {"CU_MEM_ADVISE_SET_PREFERRED_LOCATION", {"hipMemAdviseSetPreferredLocation", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 3 // API_RUNTIME ANALOGUE (cudaMemAdviseSetPreferredLocation = 3) - {"CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION", {"hipMemAdviseUnsetPreferredLocation", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 4 // API_RUNTIME ANALOGUE (cudaMemAdviseUnsetPreferredLocation = 4) - {"CU_MEM_ADVISE_SET_ACCESSED_BY", {"hipMemAdviseSetAccessedBy", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 5 // API_RUNTIME ANALOGUE (cudaMemAdviseSetAccessedBy = 5) - {"CU_MEM_ADVISE_UNSET_ACCESSED_BY", {"hipMemAdviseUnsetAccessedBy", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 6 // API_RUNTIME ANALOGUE (cudaMemAdviseUnsetAccessedBy = 6) + {"CU_MEM_ADVISE_SET_READ_MOSTLY", + {"hipMemAdviseSetReadMostly", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 1 // API_RUNTIME ANALOGUE (cudaMemAdviseSetReadMostly = 1) + {"CU_MEM_ADVISE_UNSET_READ_MOSTLY", + {"hipMemAdviseUnsetReadMostly", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 2 // API_RUNTIME ANALOGUE (cudaMemAdviseUnsetReadMostly = 2) + {"CU_MEM_ADVISE_SET_PREFERRED_LOCATION", + {"hipMemAdviseSetPreferredLocation", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 3 // API_RUNTIME ANALOGUE (cudaMemAdviseSetPreferredLocation = 3) + {"CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION", + {"hipMemAdviseUnsetPreferredLocation", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 4 // API_RUNTIME ANALOGUE (cudaMemAdviseUnsetPreferredLocation = 4) + {"CU_MEM_ADVISE_SET_ACCESSED_BY", + {"hipMemAdviseSetAccessedBy", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 5 // API_RUNTIME ANALOGUE (cudaMemAdviseSetAccessedBy = 5) + {"CU_MEM_ADVISE_UNSET_ACCESSED_BY", + {"hipMemAdviseUnsetAccessedBy", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 6 // API_RUNTIME ANALOGUE (cudaMemAdviseUnsetAccessedBy = 6) // CUmem_range_attribute - // {"CUmem_range_attribute_enum", {"hipMemRangeAttribute", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY", {"hipMemRangeAttributeReadMostly", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 1 // API_RUNTIME ANALOGUE (cudaMemRangeAttributeReadMostly = 1) - {"CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION", {"hipMemRangeAttributePreferredLocation", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 2 // API_RUNTIME ANALOGUE (cudaMemRangeAttributePreferredLocation = 2) - {"CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY", {"hipMemRangeAttributeAccessedBy", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 3 // API_RUNTIME ANALOGUE (cudaMemRangeAttributeAccessedBy = 3) - {"CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION", {"hipMemRangeAttributeLastPrefetchLocation", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 4 // API_RUNTIME ANALOGUE (cudaMemRangeAttributeLastPrefetchLocation = 4) + // {"CUmem_range_attribute_enum", {"hipMemRangeAttribute", CONV_TYPE, API_DRIVER, + // HIP_UNSUPPORTED}}, + {"CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY", + {"hipMemRangeAttributeReadMostly", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 1 // API_RUNTIME ANALOGUE (cudaMemRangeAttributeReadMostly = 1) + {"CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION", + {"hipMemRangeAttributePreferredLocation", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 2 // API_RUNTIME ANALOGUE (cudaMemRangeAttributePreferredLocation = 2) + {"CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY", + {"hipMemRangeAttributeAccessedBy", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 3 // API_RUNTIME ANALOGUE (cudaMemRangeAttributeAccessedBy = 3) + {"CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION", + {"hipMemRangeAttributeLastPrefetchLocation", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 4 // API_RUNTIME ANALOGUE (cudaMemRangeAttributeLastPrefetchLocation = + // 4) // CUctx_flags enum - {"CU_CTX_SCHED_AUTO", {"HIP_CTX_SCHED_AUTO", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 - {"CU_CTX_SCHED_SPIN", {"HIP_CTX_SCHED_SPIN", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 - {"CU_CTX_SCHED_YIELD", {"HIP_CTX_SCHED_YIELD", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 - {"CU_CTX_SCHED_BLOCKING_SYNC", {"HIP_CTX_SCHED_BLOCKING_SYNC", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 - {"CU_CTX_BLOCKING_SYNC", {"HIP_CTX_BLOCKING_SYNC", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 - {"CU_CTX_SCHED_MASK", {"HIP_CTX_SCHED_MASK", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x07 - {"CU_CTX_MAP_HOST", {"HIP_CTX_MAP_HOST", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x08 - {"CU_CTX_LMEM_RESIZE_TO_MAX", {"HIP_CTX_LMEM_RESIZE_TO_MAX", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x10 - {"CU_CTX_FLAGS_MASK", {"HIP_CTX_FLAGS_MASK", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x1f + {"CU_CTX_SCHED_AUTO", {"HIP_CTX_SCHED_AUTO", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 + {"CU_CTX_SCHED_SPIN", {"HIP_CTX_SCHED_SPIN", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 + {"CU_CTX_SCHED_YIELD", + {"HIP_CTX_SCHED_YIELD", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 + {"CU_CTX_SCHED_BLOCKING_SYNC", + {"HIP_CTX_SCHED_BLOCKING_SYNC", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 + {"CU_CTX_BLOCKING_SYNC", + {"HIP_CTX_BLOCKING_SYNC", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 + {"CU_CTX_SCHED_MASK", {"HIP_CTX_SCHED_MASK", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x07 + {"CU_CTX_MAP_HOST", {"HIP_CTX_MAP_HOST", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x08 + {"CU_CTX_LMEM_RESIZE_TO_MAX", + {"HIP_CTX_LMEM_RESIZE_TO_MAX", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x10 + {"CU_CTX_FLAGS_MASK", {"HIP_CTX_FLAGS_MASK", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x1f // Defines - {"CU_LAUNCH_PARAM_BUFFER_POINTER", {"HIP_LAUNCH_PARAM_BUFFER_POINTER", CONV_TYPE, API_DRIVER}}, // ((void*)0x01) - {"CU_LAUNCH_PARAM_BUFFER_SIZE", {"HIP_LAUNCH_PARAM_BUFFER_SIZE", CONV_TYPE, API_DRIVER}}, // ((void*)0x02) - {"CU_LAUNCH_PARAM_END", {"HIP_LAUNCH_PARAM_END", CONV_TYPE, API_DRIVER}}, // ((void*)0x00) - {"CU_IPC_HANDLE_SIZE", {"HIP_LAUNCH_PARAM_END", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 64 - {"CU_MEMHOSTALLOC_DEVICEMAP", {"HIP_MEMHOSTALLOC_DEVICEMAP", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 - {"CU_MEMHOSTALLOC_PORTABLE", {"HIP_MEMHOSTALLOC_PORTABLE", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 - {"CU_MEMHOSTALLOC_WRITECOMBINED", {"HIP_MEMHOSTALLOC_WRITECOMBINED", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 - {"CU_MEMHOSTREGISTER_DEVICEMAP", {"HIP_MEMHOSTREGISTER_DEVICEMAP", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 - {"CU_MEMHOSTREGISTER_IOMEMORY", {"HIP_MEMHOSTREGISTER_IOMEMORY", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 - {"CU_MEMHOSTREGISTER_PORTABLE", {"HIP_MEMHOSTREGISTER_PORTABLE", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 - {"CU_PARAM_TR_DEFAULT", {"HIP_PARAM_TR_DEFAULT", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // -1 - {"CU_STREAM_LEGACY", {"HIP_STREAM_LEGACY", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // ((CUstream)0x1) - {"CU_STREAM_PER_THREAD", {"HIP_STREAM_PER_THREAD", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // ((CUstream)0x2) - {"CU_TRSA_OVERRIDE_FORMAT", {"HIP_TRSA_OVERRIDE_FORMAT", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 - {"CU_TRSF_NORMALIZED_COORDINATES", {"HIP_TRSF_NORMALIZED_COORDINATES", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}},// 0x02 - {"CU_TRSF_READ_AS_INTEGER", {"HIP_TRSF_READ_AS_INTEGER", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 - {"CU_TRSF_SRGB", {"HIP_TRSF_SRGB", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x10 + {"CU_LAUNCH_PARAM_BUFFER_POINTER", + {"HIP_LAUNCH_PARAM_BUFFER_POINTER", CONV_TYPE, API_DRIVER}}, // ((void*)0x01) + {"CU_LAUNCH_PARAM_BUFFER_SIZE", + {"HIP_LAUNCH_PARAM_BUFFER_SIZE", CONV_TYPE, API_DRIVER}}, // ((void*)0x02) + {"CU_LAUNCH_PARAM_END", {"HIP_LAUNCH_PARAM_END", CONV_TYPE, API_DRIVER}}, // ((void*)0x00) + {"CU_IPC_HANDLE_SIZE", {"HIP_LAUNCH_PARAM_END", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 64 + {"CU_MEMHOSTALLOC_DEVICEMAP", + {"HIP_MEMHOSTALLOC_DEVICEMAP", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 + {"CU_MEMHOSTALLOC_PORTABLE", + {"HIP_MEMHOSTALLOC_PORTABLE", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 + {"CU_MEMHOSTALLOC_WRITECOMBINED", + {"HIP_MEMHOSTALLOC_WRITECOMBINED", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 + {"CU_MEMHOSTREGISTER_DEVICEMAP", + {"HIP_MEMHOSTREGISTER_DEVICEMAP", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 + {"CU_MEMHOSTREGISTER_IOMEMORY", + {"HIP_MEMHOSTREGISTER_IOMEMORY", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 + {"CU_MEMHOSTREGISTER_PORTABLE", + {"HIP_MEMHOSTREGISTER_PORTABLE", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 + {"CU_PARAM_TR_DEFAULT", + {"HIP_PARAM_TR_DEFAULT", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // -1 + {"CU_STREAM_LEGACY", + {"HIP_STREAM_LEGACY", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // ((CUstream)0x1) + {"CU_STREAM_PER_THREAD", + {"HIP_STREAM_PER_THREAD", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // ((CUstream)0x2) + {"CU_TRSA_OVERRIDE_FORMAT", + {"HIP_TRSA_OVERRIDE_FORMAT", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 + {"CU_TRSF_NORMALIZED_COORDINATES", + {"HIP_TRSF_NORMALIZED_COORDINATES", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 + {"CU_TRSF_READ_AS_INTEGER", + {"HIP_TRSF_READ_AS_INTEGER", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 + {"CU_TRSF_SRGB", {"HIP_TRSF_SRGB", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x10 // Deprecated, use CUDA_ARRAY3D_LAYERED - {"CUDA_ARRAY3D_2DARRAY", {"HIP_ARRAY3D_LAYERED", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 - {"CUDA_ARRAY3D_CUBEMAP", {"HIP_ARRAY3D_CUBEMAP", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 - {"CUDA_ARRAY3D_DEPTH_TEXTURE", {"HIP_ARRAY3D_DEPTH_TEXTURE", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x10 - {"CUDA_ARRAY3D_LAYERED", {"HIP_ARRAY3D_LAYERED", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 - {"CUDA_ARRAY3D_SURFACE_LDST", {"HIP_ARRAY3D_SURFACE_LDST", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 - {"CUDA_ARRAY3D_TEXTURE_GATHER", {"HIP_ARRAY3D_TEXTURE_GATHER", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x08 - {"CUDA_VERSION", {"HIP_VERSION", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 7050 + {"CUDA_ARRAY3D_2DARRAY", + {"HIP_ARRAY3D_LAYERED", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 + {"CUDA_ARRAY3D_CUBEMAP", + {"HIP_ARRAY3D_CUBEMAP", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 + {"CUDA_ARRAY3D_DEPTH_TEXTURE", + {"HIP_ARRAY3D_DEPTH_TEXTURE", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x10 + {"CUDA_ARRAY3D_LAYERED", + {"HIP_ARRAY3D_LAYERED", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 + {"CUDA_ARRAY3D_SURFACE_LDST", + {"HIP_ARRAY3D_SURFACE_LDST", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 + {"CUDA_ARRAY3D_TEXTURE_GATHER", + {"HIP_ARRAY3D_TEXTURE_GATHER", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x08 + {"CUDA_VERSION", {"HIP_VERSION", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 7050 // CUdevice_attribute_enum values... - {"CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK", {"hipDeviceAttributeMaxThreadsPerBlock", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 1 // API_Runtime ANALOGUE (cudaDevAttrMaxThreadsPerBlock = 1) - {"CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X", {"hipDeviceAttributeMaxBlockDimX", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 2 // API_Runtime ANALOGUE (cudaDevAttrMaxBlockDimX = 2) - {"CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y", {"hipDeviceAttributeMaxBlockDimY", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 3 // API_Runtime ANALOGUE (cudaDevAttrMaxBlockDimY = 3) - {"CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z", {"hipDeviceAttributeMaxBlockDimZ", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 4 // API_Runtime ANALOGUE (cudaDevAttrMaxBlockDimZ = 4) - {"CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X", {"hipDeviceAttributeMaxGridDimX", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 5 // API_Runtime ANALOGUE (cudaDevAttrMaxGridDimX =5) - {"CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y", {"hipDeviceAttributeMaxGridDimY", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 6 // API_Runtime ANALOGUE (cudaDevAttrMaxGridDimY = 6) - {"CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z", {"hipDeviceAttributeMaxGridDimZ", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 7 // API_Runtime ANALOGUE (cudaDevAttrMaxGridDimZ - 7) - {"CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK", {"hipDeviceAttributeMaxSharedMemoryPerBlock", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 8 // API_Runtime ANALOGUE (cudaDevAttrMaxSharedMemoryPerBlock = 8) + {"CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK", + {"hipDeviceAttributeMaxThreadsPerBlock", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 1 // API_Runtime ANALOGUE (cudaDevAttrMaxThreadsPerBlock = 1) + {"CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X", + {"hipDeviceAttributeMaxBlockDimX", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 2 // API_Runtime ANALOGUE (cudaDevAttrMaxBlockDimX = 2) + {"CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y", + {"hipDeviceAttributeMaxBlockDimY", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 3 // API_Runtime ANALOGUE (cudaDevAttrMaxBlockDimY = 3) + {"CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z", + {"hipDeviceAttributeMaxBlockDimZ", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 4 // API_Runtime ANALOGUE (cudaDevAttrMaxBlockDimZ = 4) + {"CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X", + {"hipDeviceAttributeMaxGridDimX", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 5 // API_Runtime ANALOGUE (cudaDevAttrMaxGridDimX =5) + {"CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y", + {"hipDeviceAttributeMaxGridDimY", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 6 // API_Runtime ANALOGUE (cudaDevAttrMaxGridDimY = 6) + {"CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z", + {"hipDeviceAttributeMaxGridDimZ", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 7 // API_Runtime ANALOGUE (cudaDevAttrMaxGridDimZ - 7) + {"CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK", + {"hipDeviceAttributeMaxSharedMemoryPerBlock", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 8 // API_Runtime ANALOGUE (cudaDevAttrMaxSharedMemoryPerBlock = 8) // Deprecated, use CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK - {"CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK", {"hipDeviceAttributeMaxSharedMemoryPerBlock", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 8 - {"CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY", {"hipDeviceAttributeTotalConstantMemory", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 9 // API_Runtime ANALOGUE (cudaDevAttrTotalConstantMemory = 9) - {"CU_DEVICE_ATTRIBUTE_WARP_SIZE", {"hipDeviceAttributeWarpSize", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 10 // API_Runtime ANALOGUE (cudaDevAttrWarpSize = 10) - {"CU_DEVICE_ATTRIBUTE_MAX_PITCH", {"hipDeviceAttributeMaxPitch", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 11 // API_Runtime ANALOGUE (cudaDevAttrMaxPitch = 11) - {"CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK", {"hipDeviceAttributeMaxRegistersPerBlock", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 12 // API_Runtime ANALOGUE (cudaDevAttrMaxRegistersPerBlock = 12) - {"CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK", {"hipDeviceAttributeMaxRegistersPerBlock", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 12 - {"CU_DEVICE_ATTRIBUTE_CLOCK_RATE", {"hipDeviceAttributeClockRate", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 13 // API_Runtime ANALOGUE (cudaDevAttrMaxRegistersPerBlock = 13) - {"CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT", {"hipDeviceAttributeTextureAlignment", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 14 // API_Runtime ANALOGUE (cudaDevAttrTextureAlignment = 14) + {"CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK", + {"hipDeviceAttributeMaxSharedMemoryPerBlock", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 8 + {"CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY", + {"hipDeviceAttributeTotalConstantMemory", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 9 // API_Runtime ANALOGUE (cudaDevAttrTotalConstantMemory = 9) + {"CU_DEVICE_ATTRIBUTE_WARP_SIZE", + {"hipDeviceAttributeWarpSize", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 10 // API_Runtime ANALOGUE (cudaDevAttrWarpSize = 10) + {"CU_DEVICE_ATTRIBUTE_MAX_PITCH", + {"hipDeviceAttributeMaxPitch", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 11 // API_Runtime ANALOGUE (cudaDevAttrMaxPitch = 11) + {"CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK", + {"hipDeviceAttributeMaxRegistersPerBlock", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 12 // API_Runtime ANALOGUE (cudaDevAttrMaxRegistersPerBlock = 12) + {"CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK", + {"hipDeviceAttributeMaxRegistersPerBlock", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 12 + {"CU_DEVICE_ATTRIBUTE_CLOCK_RATE", + {"hipDeviceAttributeClockRate", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 13 // API_Runtime ANALOGUE (cudaDevAttrMaxRegistersPerBlock = 13) + {"CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT", + {"hipDeviceAttributeTextureAlignment", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 14 // API_Runtime ANALOGUE (cudaDevAttrTextureAlignment = 14) // Deprecated. Use instead CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT - {"CU_DEVICE_ATTRIBUTE_GPU_OVERLAP", {"hipDeviceAttributeAsyncEngineCount", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 15 // API_Runtime ANALOGUE (cudaDevAttrGpuOverlap = 15) - {"CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT", {"hipDeviceAttributeMultiprocessorCount", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 16 // API_Runtime ANALOGUE (cudaDevAttrMultiProcessorCount = 16) - {"CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT", {"hipDeviceAttributeKernelExecTimeout", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 17 // API_Runtime ANALOGUE (cudaDevAttrKernelExecTimeout = 17) - {"CU_DEVICE_ATTRIBUTE_INTEGRATED", {"hipDeviceAttributeIntegrated", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 18 // API_Runtime ANALOGUE (cudaDevAttrIntegrated = 18) - {"CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY", {"hipDeviceAttributeCanMapHostMemory", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 19 // API_Runtime ANALOGUE (cudaDevAttrCanMapHostMemory = 19) - {"CU_DEVICE_ATTRIBUTE_COMPUTE_MODE", {"hipDeviceAttributeComputeMode", CONV_TYPE, API_DRIVER}}, // 20 // API_Runtime ANALOGUE (cudaDevAttrComputeMode = 20) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH", {"hipDeviceAttributeMaxTexture1DWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 21 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture1DWidth = 21) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH", {"hipDeviceAttributeMaxTexture2DWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 22 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DWidth = 22) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT", {"hipDeviceAttributeMaxTexture2DHeight", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 23 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DHeight = 23) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH", {"hipDeviceAttributeMaxTexture3DWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 24 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture3DWidth = 24) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT", {"hipDeviceAttributeMaxTexture3DHeight", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 25 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture3DHeight = 25) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH", {"hipDeviceAttributeMaxTexture3DDepth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 26 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture3DDepth = 26) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH", {"hipDeviceAttributeMaxTexture2DLayeredWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 27 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLayeredWidth = 27) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT", {"hipDeviceAttributeMaxTexture2DLayeredHeight", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 28 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLayeredHeight = 28) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS", {"hipDeviceAttributeMaxTexture2DLayeredLayers", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 29 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLayeredLayers = 29) + {"CU_DEVICE_ATTRIBUTE_GPU_OVERLAP", + {"hipDeviceAttributeAsyncEngineCount", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 15 // API_Runtime ANALOGUE (cudaDevAttrGpuOverlap = 15) + {"CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT", + {"hipDeviceAttributeMultiprocessorCount", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 16 // API_Runtime ANALOGUE (cudaDevAttrMultiProcessorCount = 16) + {"CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT", + {"hipDeviceAttributeKernelExecTimeout", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 17 // API_Runtime ANALOGUE (cudaDevAttrKernelExecTimeout = 17) + {"CU_DEVICE_ATTRIBUTE_INTEGRATED", + {"hipDeviceAttributeIntegrated", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 18 // API_Runtime ANALOGUE (cudaDevAttrIntegrated = 18) + {"CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY", + {"hipDeviceAttributeCanMapHostMemory", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 19 // API_Runtime ANALOGUE (cudaDevAttrCanMapHostMemory = 19) + {"CU_DEVICE_ATTRIBUTE_COMPUTE_MODE", + {"hipDeviceAttributeComputeMode", CONV_TYPE, + API_DRIVER}}, // 20 // API_Runtime ANALOGUE (cudaDevAttrComputeMode = 20) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH", + {"hipDeviceAttributeMaxTexture1DWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 21 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture1DWidth = 21) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH", + {"hipDeviceAttributeMaxTexture2DWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 22 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DWidth = 22) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT", + {"hipDeviceAttributeMaxTexture2DHeight", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 23 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DHeight = 23) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH", + {"hipDeviceAttributeMaxTexture3DWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 24 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture3DWidth = 24) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT", + {"hipDeviceAttributeMaxTexture3DHeight", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 25 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture3DHeight = 25) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH", + {"hipDeviceAttributeMaxTexture3DDepth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 26 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture3DDepth = 26) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH", + {"hipDeviceAttributeMaxTexture2DLayeredWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 27 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLayeredWidth = 27) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT", + {"hipDeviceAttributeMaxTexture2DLayeredHeight", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 28 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLayeredHeight = 28) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS", + {"hipDeviceAttributeMaxTexture2DLayeredLayers", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 29 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLayeredLayers = 29) // Deprecated, use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH", {"hipDeviceAttributeMaxTexture2DLayeredWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 27 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLayeredWidth = 27) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH", + {"hipDeviceAttributeMaxTexture2DLayeredWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 27 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLayeredWidth = 27) // Deprecated, use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT", {"hipDeviceAttributeMaxTexture2DLayeredHeight", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 28 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLayeredHeight = 28) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT", + {"hipDeviceAttributeMaxTexture2DLayeredHeight", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 28 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLayeredHeight = 28) // Deprecated, use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES", {"hipDeviceAttributeMaxTexture2DLayeredLayers", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 29 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLayeredLayers = 29) - {"CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT", {"hipDeviceAttributeSurfaceAlignment", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 30 // API_Runtime ANALOGUE (cudaDevAttrSurfaceAlignment = 30) - {"CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS", {"hipDeviceAttributeConcurrentKernels", CONV_TYPE, API_DRIVER}}, // 31 // API_Runtime ANALOGUE (cudaDevAttrConcurrentKernels = 31) - {"CU_DEVICE_ATTRIBUTE_ECC_ENABLED", {"hipDeviceAttributeEccEnabled", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 32 // API_Runtime ANALOGUE (cudaDevAttrEccEnabled = 32) - {"CU_DEVICE_ATTRIBUTE_PCI_BUS_ID", {"hipDeviceAttributePciBusId", CONV_TYPE, API_DRIVER}}, // 33 // API_Runtime ANALOGUE (cudaDevAttrPciBusId = 33) - {"CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID", {"hipDeviceAttributePciDeviceId", CONV_TYPE, API_DRIVER}}, // 34 // API_Runtime ANALOGUE (cudaDevAttrPciDeviceId = 34) - {"CU_DEVICE_ATTRIBUTE_TCC_DRIVER", {"hipDeviceAttributeTccDriver", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 35 // API_Runtime ANALOGUE (cudaDevAttrTccDriver = 35) - {"CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE", {"hipDeviceAttributeMemoryClockRate", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 36 // API_Runtime ANALOGUE (cudaDevAttrMemoryClockRate = 36) - {"CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH", {"hipDeviceAttributeMemoryBusWidth", CONV_TYPE, API_DRIVER}}, // 37 // API_Runtime ANALOGUE (cudaDevAttrGlobalMemoryBusWidth = 37) - {"CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE", {"hipDeviceAttributeL2CacheSize", CONV_TYPE, API_DRIVER}}, // 38 // API_Runtime ANALOGUE (cudaDevAttrL2CacheSize = 38) - {"CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR", {"hipDeviceAttributeMaxThreadsPerMultiProcessor", CONV_TYPE, API_DRIVER}}, // 39 // API_Runtime ANALOGUE (cudaDevAttrMaxThreadsPerMultiProcessor = 39) - {"CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT", {"hipDeviceAttributeAsyncEngineCount", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 40 // API_Runtime ANALOGUE (cudaDevAttrAsyncEngineCount = 40) - {"CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING", {"hipDeviceAttributeUnifiedAddressing", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 41 // API_Runtime ANALOGUE (cudaDevAttrUnifiedAddressing = 41) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH", {"hipDeviceAttributeMaxTexture1DLayeredWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 42 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture1DLayeredWidth = 42) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS", {"hipDeviceAttributeMaxTexture1DLayeredLayers", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 43 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture1DLayeredLayers = 43) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES", + {"hipDeviceAttributeMaxTexture2DLayeredLayers", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 29 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLayeredLayers = 29) + {"CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT", + {"hipDeviceAttributeSurfaceAlignment", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 30 // API_Runtime ANALOGUE (cudaDevAttrSurfaceAlignment = 30) + {"CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS", + {"hipDeviceAttributeConcurrentKernels", CONV_TYPE, + API_DRIVER}}, // 31 // API_Runtime ANALOGUE (cudaDevAttrConcurrentKernels = 31) + {"CU_DEVICE_ATTRIBUTE_ECC_ENABLED", + {"hipDeviceAttributeEccEnabled", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 32 // API_Runtime ANALOGUE (cudaDevAttrEccEnabled = 32) + {"CU_DEVICE_ATTRIBUTE_PCI_BUS_ID", + {"hipDeviceAttributePciBusId", CONV_TYPE, + API_DRIVER}}, // 33 // API_Runtime ANALOGUE (cudaDevAttrPciBusId = 33) + {"CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID", + {"hipDeviceAttributePciDeviceId", CONV_TYPE, + API_DRIVER}}, // 34 // API_Runtime ANALOGUE (cudaDevAttrPciDeviceId = 34) + {"CU_DEVICE_ATTRIBUTE_TCC_DRIVER", + {"hipDeviceAttributeTccDriver", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 35 // API_Runtime ANALOGUE (cudaDevAttrTccDriver = 35) + {"CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE", + {"hipDeviceAttributeMemoryClockRate", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 36 // API_Runtime ANALOGUE (cudaDevAttrMemoryClockRate = 36) + {"CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH", + {"hipDeviceAttributeMemoryBusWidth", CONV_TYPE, + API_DRIVER}}, // 37 // API_Runtime ANALOGUE (cudaDevAttrGlobalMemoryBusWidth = 37) + {"CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE", + {"hipDeviceAttributeL2CacheSize", CONV_TYPE, + API_DRIVER}}, // 38 // API_Runtime ANALOGUE (cudaDevAttrL2CacheSize = 38) + {"CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR", + {"hipDeviceAttributeMaxThreadsPerMultiProcessor", CONV_TYPE, + API_DRIVER}}, // 39 // API_Runtime ANALOGUE (cudaDevAttrMaxThreadsPerMultiProcessor = 39) + {"CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT", + {"hipDeviceAttributeAsyncEngineCount", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 40 // API_Runtime ANALOGUE (cudaDevAttrAsyncEngineCount = 40) + {"CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING", + {"hipDeviceAttributeUnifiedAddressing", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 41 // API_Runtime ANALOGUE (cudaDevAttrUnifiedAddressing = 41) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH", + {"hipDeviceAttributeMaxTexture1DLayeredWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 42 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture1DLayeredWidth = 42) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS", + {"hipDeviceAttributeMaxTexture1DLayeredLayers", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 43 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture1DLayeredLayers = 43) // deprecated, do not use - {"CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER", {"hipDeviceAttributeCanTex2DGather", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 44 // API_Runtime ANALOGUE (no) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH", {"hipDeviceAttributeMaxTexture2DGatherWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 45 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DGatherWidth = 45) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT", {"hipDeviceAttributeMaxTexture2DGatherHeight", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 46 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DGatherHeight = 46) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE", {"hipDeviceAttributeMaxTexture3DWidthAlternate", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 47 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture3DWidthAlt = 47) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE", {"hipDeviceAttributeMaxTexture3DHeightAlternate", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 48 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture3DHeightAlt = 48) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE", {"hipDeviceAttributeMaxTexture3DDepthAlternate", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 49 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture3DDepthAlt = 49) - {"CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID", {"hipDeviceAttributePciDomainId", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 50 // API_Runtime ANALOGUE (cudaDevAttrPciDomainId = 50) - {"CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT", {"hipDeviceAttributeTexturePitchAlignment", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 51 // API_Runtime ANALOGUE (cudaDevAttrTexturePitchAlignment = 51) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH", {"hipDeviceAttributeMaxTextureCubemapWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 52 // API_Runtime ANALOGUE (cudaDevAttrMaxTextureCubemapWidth = 52) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH", {"hipDeviceAttributeMaxTextureCubemapLayeredWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 53 // API_Runtime ANALOGUE (cudaDevAttrMaxTextureCubemapLayeredWidth = 53) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS", {"hipDeviceAttributeMaxTextureCubemapLayeredLayers", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 54 // API_Runtime ANALOGUE (cudaDevAttrMaxTextureCubemapLayeredLayers = 54) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH", {"hipDeviceAttributeMaxSurface1DWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 55 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface1DWidth = 55) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH", {"hipDeviceAttributeMaxSurface2DWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 56 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface2DWidth = 56) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT", {"hipDeviceAttributeMaxSurface2DHeight", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 57 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface2DHeight = 57) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH", {"hipDeviceAttributeMaxSurface3DWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 58 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface3DWidth = 58) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT", {"hipDeviceAttributeMaxSurface3DHeight", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 59 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface3DHeight = 59) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH", {"hipDeviceAttributeMaxSurface3DDepth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 60 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface3DDepth = 60) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH", {"hipDeviceAttributeMaxSurface1DLayeredWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 61 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface1DLayeredWidth = 61) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS", {"hipDeviceAttributeMaxSurface1DLayeredLayers", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 62 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface1DLayeredLayers = 62) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH", {"hipDeviceAttributeMaxSurface2DLayeredWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 63 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface2DLayeredWidth = 63) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT", {"hipDeviceAttributeMaxSurface2DLayeredHeight", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 64 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface2DLayeredHeight = 64) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS", {"hipDeviceAttributeMaxSurface2DLayeredLayers", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 65 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface2DLayeredLayers = 65) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH", {"hipDeviceAttributeMaxSurfaceCubemapWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 66 // API_Runtime ANALOGUE (cudaDevAttrMaxSurfaceCubemapWidth = 66) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH", {"hipDeviceAttributeMaxSurfaceCubemapLayeredWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 67 // API_Runtime ANALOGUE (cudaDevAttrMaxSurfaceCubemapLayeredWidth = 67) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS", {"hipDeviceAttributeMaxSurfaceCubemapLayeredLayers", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 68 // API_Runtime ANALOGUE (cudaDevAttrMaxSurfaceCubemapLayeredLayers = 68) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH", {"hipDeviceAttributeMaxTexture1DLinearWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 69 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture1DLinearWidth = 69) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH", {"hipDeviceAttributeMaxTexture2DLinearWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 70 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLinearWidth = 70) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT", {"hipDeviceAttributeMaxTexture2DLinearHeight", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 71 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLinearHeight = 71) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH", {"hipDeviceAttributeMaxTexture2DLinearPitch", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 72 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLinearPitch = 72) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH", {"hipDeviceAttributeMaxTexture2DMipmappedWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 73 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DMipmappedWidth = 73) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT", {"hipDeviceAttributeMaxTexture2DMipmappedHeight", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 74 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DMipmappedHeight = 74) - {"CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR", {"hipDeviceAttributeComputeCapabilityMajor", CONV_TYPE, API_DRIVER}}, // 75 // API_Runtime ANALOGUE (cudaDevAttrComputeCapabilityMajor = 75) - {"CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR", {"hipDeviceAttributeComputeCapabilityMinor", CONV_TYPE, API_DRIVER}}, // 76 // API_Runtime ANALOGUE (cudaDevAttrComputeCapabilityMinor = 76) - {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH", {"hipDeviceAttributeMaxTexture1DMipmappedWidth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 77 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture1DMipmappedWidth = 77) - {"CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED", {"hipDeviceAttributeStreamPrioritiesSupported", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 78 // API_Runtime ANALOGUE (cudaDevAttrStreamPrioritiesSupported = 78) - {"CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED", {"hipDeviceAttributeGlobalL1CacheSupported", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 79 // API_Runtime ANALOGUE (cudaDevAttrGlobalL1CacheSupported = 79) - {"CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED", {"hipDeviceAttributeLocalL1CacheSupported", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 80 // API_Runtime ANALOGUE (cudaDevAttrLocalL1CacheSupported = 80) - {"CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR", {"hipDeviceAttributeMaxSharedMemoryPerMultiprocessor", CONV_TYPE, API_DRIVER}}, // 81 // API_Runtime ANALOGUE (cudaDevAttrMaxSharedMemoryPerMultiprocessor = 81) - {"CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR", {"hipDeviceAttributeMaxRegistersPerMultiprocessor", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 82 // API_Runtime ANALOGUE (cudaDevAttrMaxRegistersPerMultiprocessor = 82) - {"CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY", {"hipDeviceAttributeManagedMemory", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 83 // API_Runtime ANALOGUE (cudaDevAttrManagedMemory = 83) - {"CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD", {"hipDeviceAttributeIsMultiGpuBoard", CONV_TYPE, API_DRIVER}}, // 84 // API_Runtime ANALOGUE (cudaDevAttrIsMultiGpuBoard = 84) - {"CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID", {"hipDeviceAttributeMultiGpuBoardGroupId", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 85 // API_Runtime ANALOGUE (cudaDevAttrMultiGpuBoardGroupID = 85) - {"CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED", {"hipDeviceAttributeHostNativeAtomicSupported", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 86 // API_Runtime ANALOGUE (cudaDevAttrHostNativeAtomicSupported = 86) - {"CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO", {"hipDeviceAttributeSingleToDoublePrecisionPerfRatio", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 87 // API_Runtime ANALOGUE (cudaDevAttrSingleToDoublePrecisionPerfRatio = 87) - {"CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS", {"hipDeviceAttributePageableMemoryAccess", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 88 // API_Runtime ANALOGUE (cudaDevAttrPageableMemoryAccess = 88) - {"CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS", {"hipDeviceAttributeConcurrentManagedAccess", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 89 // API_Runtime ANALOGUE (cudaDevAttrConcurrentManagedAccess = 89) - {"CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED", {"hipDeviceAttributeComputePreemptionSupported", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 90 // API_Runtime ANALOGUE (cudaDevAttrComputePreemptionSupported = 90) - {"CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM", {"hipDeviceAttributeCanUseHostPointerForRegisteredMem", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 91 // API_Runtime ANALOGUE (cudaDevAttrCanUseHostPointerForRegisteredMem = 91) + {"CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER", + {"hipDeviceAttributeCanTex2DGather", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 44 // API_Runtime ANALOGUE (no) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH", + {"hipDeviceAttributeMaxTexture2DGatherWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 45 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DGatherWidth = 45) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT", + {"hipDeviceAttributeMaxTexture2DGatherHeight", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 46 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DGatherHeight = 46) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE", + {"hipDeviceAttributeMaxTexture3DWidthAlternate", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 47 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture3DWidthAlt = 47) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE", + {"hipDeviceAttributeMaxTexture3DHeightAlternate", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 48 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture3DHeightAlt = 48) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE", + {"hipDeviceAttributeMaxTexture3DDepthAlternate", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 49 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture3DDepthAlt = 49) + {"CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID", + {"hipDeviceAttributePciDomainId", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 50 // API_Runtime ANALOGUE (cudaDevAttrPciDomainId = 50) + {"CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT", + {"hipDeviceAttributeTexturePitchAlignment", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 51 // API_Runtime ANALOGUE (cudaDevAttrTexturePitchAlignment = 51) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH", + {"hipDeviceAttributeMaxTextureCubemapWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 52 // API_Runtime ANALOGUE (cudaDevAttrMaxTextureCubemapWidth = 52) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH", + {"hipDeviceAttributeMaxTextureCubemapLayeredWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 53 // API_Runtime ANALOGUE (cudaDevAttrMaxTextureCubemapLayeredWidth = + // 53) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS", + {"hipDeviceAttributeMaxTextureCubemapLayeredLayers", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 54 // API_Runtime ANALOGUE (cudaDevAttrMaxTextureCubemapLayeredLayers = + // 54) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH", + {"hipDeviceAttributeMaxSurface1DWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 55 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface1DWidth = 55) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH", + {"hipDeviceAttributeMaxSurface2DWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 56 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface2DWidth = 56) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT", + {"hipDeviceAttributeMaxSurface2DHeight", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 57 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface2DHeight = 57) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH", + {"hipDeviceAttributeMaxSurface3DWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 58 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface3DWidth = 58) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT", + {"hipDeviceAttributeMaxSurface3DHeight", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 59 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface3DHeight = 59) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH", + {"hipDeviceAttributeMaxSurface3DDepth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 60 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface3DDepth = 60) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH", + {"hipDeviceAttributeMaxSurface1DLayeredWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 61 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface1DLayeredWidth = 61) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS", + {"hipDeviceAttributeMaxSurface1DLayeredLayers", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 62 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface1DLayeredLayers = 62) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH", + {"hipDeviceAttributeMaxSurface2DLayeredWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 63 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface2DLayeredWidth = 63) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT", + {"hipDeviceAttributeMaxSurface2DLayeredHeight", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 64 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface2DLayeredHeight = 64) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS", + {"hipDeviceAttributeMaxSurface2DLayeredLayers", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 65 // API_Runtime ANALOGUE (cudaDevAttrMaxSurface2DLayeredLayers = 65) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH", + {"hipDeviceAttributeMaxSurfaceCubemapWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 66 // API_Runtime ANALOGUE (cudaDevAttrMaxSurfaceCubemapWidth = 66) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH", + {"hipDeviceAttributeMaxSurfaceCubemapLayeredWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 67 // API_Runtime ANALOGUE (cudaDevAttrMaxSurfaceCubemapLayeredWidth = + // 67) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS", + {"hipDeviceAttributeMaxSurfaceCubemapLayeredLayers", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 68 // API_Runtime ANALOGUE (cudaDevAttrMaxSurfaceCubemapLayeredLayers = + // 68) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH", + {"hipDeviceAttributeMaxTexture1DLinearWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 69 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture1DLinearWidth = 69) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH", + {"hipDeviceAttributeMaxTexture2DLinearWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 70 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLinearWidth = 70) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT", + {"hipDeviceAttributeMaxTexture2DLinearHeight", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 71 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLinearHeight = 71) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH", + {"hipDeviceAttributeMaxTexture2DLinearPitch", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 72 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DLinearPitch = 72) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH", + {"hipDeviceAttributeMaxTexture2DMipmappedWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 73 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DMipmappedWidth = 73) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT", + {"hipDeviceAttributeMaxTexture2DMipmappedHeight", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 74 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture2DMipmappedHeight = + // 74) + {"CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR", + {"hipDeviceAttributeComputeCapabilityMajor", CONV_TYPE, + API_DRIVER}}, // 75 // API_Runtime ANALOGUE (cudaDevAttrComputeCapabilityMajor = 75) + {"CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR", + {"hipDeviceAttributeComputeCapabilityMinor", CONV_TYPE, + API_DRIVER}}, // 76 // API_Runtime ANALOGUE (cudaDevAttrComputeCapabilityMinor = 76) + {"CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH", + {"hipDeviceAttributeMaxTexture1DMipmappedWidth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 77 // API_Runtime ANALOGUE (cudaDevAttrMaxTexture1DMipmappedWidth = 77) + {"CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED", + {"hipDeviceAttributeStreamPrioritiesSupported", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 78 // API_Runtime ANALOGUE (cudaDevAttrStreamPrioritiesSupported = 78) + {"CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED", + {"hipDeviceAttributeGlobalL1CacheSupported", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 79 // API_Runtime ANALOGUE (cudaDevAttrGlobalL1CacheSupported = 79) + {"CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED", + {"hipDeviceAttributeLocalL1CacheSupported", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 80 // API_Runtime ANALOGUE (cudaDevAttrLocalL1CacheSupported = 80) + {"CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR", + {"hipDeviceAttributeMaxSharedMemoryPerMultiprocessor", CONV_TYPE, + API_DRIVER}}, // 81 // API_Runtime ANALOGUE (cudaDevAttrMaxSharedMemoryPerMultiprocessor = + // 81) + {"CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR", + {"hipDeviceAttributeMaxRegistersPerMultiprocessor", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 82 // API_Runtime ANALOGUE (cudaDevAttrMaxRegistersPerMultiprocessor = + // 82) + {"CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY", + {"hipDeviceAttributeManagedMemory", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 83 // API_Runtime ANALOGUE (cudaDevAttrManagedMemory = 83) + {"CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD", + {"hipDeviceAttributeIsMultiGpuBoard", CONV_TYPE, + API_DRIVER}}, // 84 // API_Runtime ANALOGUE (cudaDevAttrIsMultiGpuBoard = 84) + {"CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID", + {"hipDeviceAttributeMultiGpuBoardGroupId", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 85 // API_Runtime ANALOGUE (cudaDevAttrMultiGpuBoardGroupID = 85) + {"CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED", + {"hipDeviceAttributeHostNativeAtomicSupported", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 86 // API_Runtime ANALOGUE (cudaDevAttrHostNativeAtomicSupported = 86) + {"CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO", + {"hipDeviceAttributeSingleToDoublePrecisionPerfRatio", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 87 // API_Runtime ANALOGUE (cudaDevAttrSingleToDoublePrecisionPerfRatio + // = 87) + {"CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS", + {"hipDeviceAttributePageableMemoryAccess", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 88 // API_Runtime ANALOGUE (cudaDevAttrPageableMemoryAccess = 88) + {"CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS", + {"hipDeviceAttributeConcurrentManagedAccess", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 89 // API_Runtime ANALOGUE (cudaDevAttrConcurrentManagedAccess = 89) + {"CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED", + {"hipDeviceAttributeComputePreemptionSupported", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 90 // API_Runtime ANALOGUE (cudaDevAttrComputePreemptionSupported = 90) + {"CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM", + {"hipDeviceAttributeCanUseHostPointerForRegisteredMem", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 91 // API_Runtime ANALOGUE + // (cudaDevAttrCanUseHostPointerForRegisteredMem = 91) - {"CU_DEVICE_ATTRIBUTE_MAX", {"hipDeviceAttributeMax", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 92 // API_Runtime ANALOGUE (no) + {"CU_DEVICE_ATTRIBUTE_MAX", + {"hipDeviceAttributeMax", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 92 // API_Runtime ANALOGUE (no) // TODO: Analogous enum is needed in HIP. Couldn't map enum to struct hipPointerAttribute_t. // TODO: Do for Pointer Attributes the same as for Device Attributes. - // {"CUpointer_attribute_enum", {"hipPointerAttribute_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) - // {"CUpointer_attribute", {"hipPointerAttribute_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) - {"CU_POINTER_ATTRIBUTE_CONTEXT", {"hipPointerAttributeContext", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 1 // API_Runtime ANALOGUE (no) - {"CU_POINTER_ATTRIBUTE_MEMORY_TYPE", {"hipPointerAttributeMemoryType", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 2 // API_Runtime ANALOGUE (no) - {"CU_POINTER_ATTRIBUTE_DEVICE_POINTER", {"hipPointerAttributeDevicePointer", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 3 // API_Runtime ANALOGUE (no) - {"CU_POINTER_ATTRIBUTE_HOST_POINTER", {"hipPointerAttributeHostPointer", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 4 // API_Runtime ANALOGUE (no) - {"CU_POINTER_ATTRIBUTE_P2P_TOKENS", {"hipPointerAttributeP2pTokens", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 5 // API_Runtime ANALOGUE (no) - {"CU_POINTER_ATTRIBUTE_SYNC_MEMOPS", {"hipPointerAttributeSyncMemops", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 6 // API_Runtime ANALOGUE (no) - {"CU_POINTER_ATTRIBUTE_BUFFER_ID", {"hipPointerAttributeBufferId", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 7 // API_Runtime ANALOGUE (no) - {"CU_POINTER_ATTRIBUTE_IS_MANAGED", {"hipPointerAttributeIsManaged", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 8 // API_Runtime ANALOGUE (no) + // {"CUpointer_attribute_enum", {"hipPointerAttribute_t", CONV_TYPE, API_DRIVER, + // HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + // {"CUpointer_attribute", {"hipPointerAttribute_t", CONV_TYPE, API_DRIVER, + // HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + {"CU_POINTER_ATTRIBUTE_CONTEXT", + {"hipPointerAttributeContext", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 1 // API_Runtime ANALOGUE (no) + {"CU_POINTER_ATTRIBUTE_MEMORY_TYPE", + {"hipPointerAttributeMemoryType", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 2 // API_Runtime ANALOGUE (no) + {"CU_POINTER_ATTRIBUTE_DEVICE_POINTER", + {"hipPointerAttributeDevicePointer", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 3 // API_Runtime ANALOGUE (no) + {"CU_POINTER_ATTRIBUTE_HOST_POINTER", + {"hipPointerAttributeHostPointer", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 4 // API_Runtime ANALOGUE (no) + {"CU_POINTER_ATTRIBUTE_P2P_TOKENS", + {"hipPointerAttributeP2pTokens", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 5 // API_Runtime ANALOGUE (no) + {"CU_POINTER_ATTRIBUTE_SYNC_MEMOPS", + {"hipPointerAttributeSyncMemops", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 6 // API_Runtime ANALOGUE (no) + {"CU_POINTER_ATTRIBUTE_BUFFER_ID", + {"hipPointerAttributeBufferId", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 7 // API_Runtime ANALOGUE (no) + {"CU_POINTER_ATTRIBUTE_IS_MANAGED", + {"hipPointerAttributeIsManaged", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 8 // API_Runtime ANALOGUE (no) // CUfunction_attribute_enum values - {"CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK", {"hipFuncAttributeMaxThreadsPerBlocks", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES", {"hipFuncAttributeSharedSizeBytes", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES", {"hipFuncAttributeConstSizeBytes", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES", {"hipFuncAttributeLocalSizeBytes", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_FUNC_ATTRIBUTE_NUM_REGS", {"hipFuncAttributeNumRegs", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_FUNC_ATTRIBUTE_PTX_VERSION", {"hipFuncAttributePtxVersion", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_FUNC_ATTRIBUTE_BINARY_VERSION", {"hipFuncAttributeBinaryVersion", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_FUNC_ATTRIBUTE_CACHE_MODE_CA", {"hipFuncAttributeCacheModeCA", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_FUNC_ATTRIBUTE_MAX", {"hipFuncAttributeMax", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK", + {"hipFuncAttributeMaxThreadsPerBlocks", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES", + {"hipFuncAttributeSharedSizeBytes", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES", + {"hipFuncAttributeConstSizeBytes", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES", + {"hipFuncAttributeLocalSizeBytes", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_FUNC_ATTRIBUTE_NUM_REGS", + {"hipFuncAttributeNumRegs", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_FUNC_ATTRIBUTE_PTX_VERSION", + {"hipFuncAttributePtxVersion", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_FUNC_ATTRIBUTE_BINARY_VERSION", + {"hipFuncAttributeBinaryVersion", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_FUNC_ATTRIBUTE_CACHE_MODE_CA", + {"hipFuncAttributeCacheModeCA", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_FUNC_ATTRIBUTE_MAX", {"hipFuncAttributeMax", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // enum CUgraphicsMapResourceFlags/CUgraphicsMapResourceFlags_enum - {"CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE", {"hipGraphicsMapFlagsNone", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaGraphicsMapFlagsNone = 0) - {"CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY", {"hipGraphicsMapFlagsReadOnly", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaGraphicsMapFlagsReadOnly = 1) - {"CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD", {"hipGraphicsMapFlagsWriteDiscard", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaGraphicsMapFlagsWriteDiscard = 2) + {"CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE", + {"hipGraphicsMapFlagsNone", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaGraphicsMapFlagsNone = 0) + {"CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY", + {"hipGraphicsMapFlagsReadOnly", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaGraphicsMapFlagsReadOnly = 1) + {"CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD", + {"hipGraphicsMapFlagsWriteDiscard", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaGraphicsMapFlagsWriteDiscard = 2) // enum CUgraphicsRegisterFlags/CUgraphicsRegisterFlags_enum - {"CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE", {"hipGraphicsRegisterFlagsNone", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaGraphicsRegisterFlagsNone = 0) - {"CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY", {"hipGraphicsRegisterFlagsReadOnly", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaGraphicsRegisterFlagsReadOnly = 1) - {"CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD", {"hipGraphicsRegisterFlagsWriteDiscard", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaGraphicsRegisterFlagsWriteDiscard = 2) - {"CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST", {"hipGraphicsRegisterFlagsSurfaceLoadStore", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 // API_Runtime ANALOGUE (cudaGraphicsRegisterFlagsSurfaceLoadStore = 4) - {"CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER", {"hipGraphicsRegisterFlagsTextureGather", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x08 // API_Runtime ANALOGUE (cudaGraphicsRegisterFlagsTextureGather = 8) + {"CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE", + {"hipGraphicsRegisterFlagsNone", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaGraphicsRegisterFlagsNone = 0) + {"CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY", + {"hipGraphicsRegisterFlagsReadOnly", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaGraphicsRegisterFlagsReadOnly = 1) + {"CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD", + {"hipGraphicsRegisterFlagsWriteDiscard", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaGraphicsRegisterFlagsWriteDiscard = + // 2) + {"CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST", + {"hipGraphicsRegisterFlagsSurfaceLoadStore", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x04 // API_Runtime ANALOGUE (cudaGraphicsRegisterFlagsSurfaceLoadStore + // = 4) + {"CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER", + {"hipGraphicsRegisterFlagsTextureGather", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x08 // API_Runtime ANALOGUE (cudaGraphicsRegisterFlagsTextureGather = + // 8) // enum CUoccupancy_flags/CUoccupancy_flags_enum - {"CU_OCCUPANCY_DEFAULT", {"hipOccupancyDefault", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaOccupancyDefault = 0x0) - {"CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE", {"hipOccupancyDisableCachingOverride", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaOccupancyDisableCachingOverride = 0x1) + {"CU_OCCUPANCY_DEFAULT", + {"hipOccupancyDefault", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaOccupancyDefault = 0x0) + {"CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE", + {"hipOccupancyDisableCachingOverride", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaOccupancyDisableCachingOverride = + // 0x1) // enum CUfunc_cache/CUfunc_cache_enum - {"CU_FUNC_CACHE_PREFER_NONE", {"hipFuncCachePreferNone", CONV_CACHE, API_DRIVER}}, // 0x00 // API_Runtime ANALOGUE (cudaFilterModePoint = 0) - {"CU_FUNC_CACHE_PREFER_SHARED", {"hipFuncCachePreferShared", CONV_CACHE, API_DRIVER}}, // 0x01 // API_Runtime ANALOGUE (cudaFuncCachePreferShared = 1) - {"CU_FUNC_CACHE_PREFER_L1", {"hipFuncCachePreferL1", CONV_CACHE, API_DRIVER}}, // 0x02 // API_Runtime ANALOGUE (cudaFuncCachePreferL1 = 2) - {"CU_FUNC_CACHE_PREFER_EQUAL", {"hipFuncCachePreferEqual", CONV_CACHE, API_DRIVER}}, // 0x03 // API_Runtime ANALOGUE (cudaFuncCachePreferEqual = 3) + {"CU_FUNC_CACHE_PREFER_NONE", + {"hipFuncCachePreferNone", CONV_CACHE, + API_DRIVER}}, // 0x00 // API_Runtime ANALOGUE (cudaFilterModePoint = 0) + {"CU_FUNC_CACHE_PREFER_SHARED", + {"hipFuncCachePreferShared", CONV_CACHE, + API_DRIVER}}, // 0x01 // API_Runtime ANALOGUE (cudaFuncCachePreferShared = 1) + {"CU_FUNC_CACHE_PREFER_L1", + {"hipFuncCachePreferL1", CONV_CACHE, + API_DRIVER}}, // 0x02 // API_Runtime ANALOGUE (cudaFuncCachePreferL1 = 2) + {"CU_FUNC_CACHE_PREFER_EQUAL", + {"hipFuncCachePreferEqual", CONV_CACHE, + API_DRIVER}}, // 0x03 // API_Runtime ANALOGUE (cudaFuncCachePreferEqual = 3) // enum CUipcMem_flags/CUipcMem_flags_enum - {"CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS", {"hipIpcMemLazyEnablePeerAccess", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x1 // API_Runtime ANALOGUE (cudaIpcMemLazyEnablePeerAccess = 0x01) + {"CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS", + {"hipIpcMemLazyEnablePeerAccess", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x1 // API_Runtime ANALOGUE (cudaIpcMemLazyEnablePeerAccess = 0x01) // JIT // enum CUjit_cacheMode/CUjit_cacheMode_enum - {"CU_JIT_CACHE_OPTION_NONE", {"hipJitCacheModeOptionNone", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_JIT_CACHE_OPTION_CG", {"hipJitCacheModeOptionCG", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_JIT_CACHE_OPTION_CA", {"hipJitCacheModeOptionCA", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_JIT_CACHE_OPTION_NONE", + {"hipJitCacheModeOptionNone", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_JIT_CACHE_OPTION_CG", {"hipJitCacheModeOptionCG", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_JIT_CACHE_OPTION_CA", {"hipJitCacheModeOptionCA", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, // enum CUjit_fallback/CUjit_fallback_enum - {"CU_PREFER_PTX", {"hipJitFallbackPreferPtx", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_PREFER_BINARY", {"hipJitFallbackPreferBinary", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_PREFER_PTX", {"hipJitFallbackPreferPtx", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_PREFER_BINARY", {"hipJitFallbackPreferBinary", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, // enum CUjit_option/CUjit_option_enum - {"CU_JIT_MAX_REGISTERS", {"hipJitOptionMaxRegisters", CONV_JIT, API_DRIVER}}, - {"CU_JIT_THREADS_PER_BLOCK", {"hipJitOptionThreadsPerBlock", CONV_JIT, API_DRIVER}}, - {"CU_JIT_WALL_TIME", {"hipJitOptionWallTime", CONV_JIT, API_DRIVER}}, - {"CU_JIT_INFO_LOG_BUFFER", {"hipJitOptionInfoLogBuffer", CONV_JIT, API_DRIVER}}, - {"CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES", {"hipJitOptionInfoLogBufferSizeBytes", CONV_JIT, API_DRIVER}}, - {"CU_JIT_ERROR_LOG_BUFFER", {"hipJitOptionErrorLogBuffer", CONV_JIT, API_DRIVER}}, - {"CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES", {"hipJitOptionErrorLogBufferSizeBytes", CONV_JIT, API_DRIVER}}, - {"CU_JIT_OPTIMIZATION_LEVEL", {"hipJitOptionOptimizationLevel", CONV_JIT, API_DRIVER}}, - {"CU_JIT_TARGET_FROM_CUCONTEXT", {"hipJitOptionTargetFromContext", CONV_JIT, API_DRIVER}}, - {"CU_JIT_TARGET", {"hipJitOptionTarget", CONV_JIT, API_DRIVER}}, - {"CU_JIT_FALLBACK_STRATEGY", {"hipJitOptionFallbackStrategy", CONV_JIT, API_DRIVER}}, - {"CU_JIT_GENERATE_DEBUG_INFO", {"hipJitOptionGenerateDebugInfo", CONV_JIT, API_DRIVER}}, - {"CU_JIT_LOG_VERBOSE", {"hipJitOptionLogVerbose", CONV_JIT, API_DRIVER}}, - {"CU_JIT_GENERATE_LINE_INFO", {"hipJitOptionGenerateLineInfo", CONV_JIT, API_DRIVER}}, - {"CU_JIT_CACHE_MODE", {"hipJitOptionCacheMode", CONV_JIT, API_DRIVER}}, - {"CU_JIT_NEW_SM3X_OPT", {"hipJitOptionSm3xOpt", CONV_JIT, API_DRIVER}}, - {"CU_JIT_FAST_COMPILE", {"hipJitOptionFastCompile", CONV_JIT, API_DRIVER}}, - {"CU_JIT_NUM_OPTIONS", {"hipJitOptionNumOptions", CONV_JIT, API_DRIVER}}, + {"CU_JIT_MAX_REGISTERS", {"hipJitOptionMaxRegisters", CONV_JIT, API_DRIVER}}, + {"CU_JIT_THREADS_PER_BLOCK", {"hipJitOptionThreadsPerBlock", CONV_JIT, API_DRIVER}}, + {"CU_JIT_WALL_TIME", {"hipJitOptionWallTime", CONV_JIT, API_DRIVER}}, + {"CU_JIT_INFO_LOG_BUFFER", {"hipJitOptionInfoLogBuffer", CONV_JIT, API_DRIVER}}, + {"CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES", + {"hipJitOptionInfoLogBufferSizeBytes", CONV_JIT, API_DRIVER}}, + {"CU_JIT_ERROR_LOG_BUFFER", {"hipJitOptionErrorLogBuffer", CONV_JIT, API_DRIVER}}, + {"CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES", + {"hipJitOptionErrorLogBufferSizeBytes", CONV_JIT, API_DRIVER}}, + {"CU_JIT_OPTIMIZATION_LEVEL", {"hipJitOptionOptimizationLevel", CONV_JIT, API_DRIVER}}, + {"CU_JIT_TARGET_FROM_CUCONTEXT", {"hipJitOptionTargetFromContext", CONV_JIT, API_DRIVER}}, + {"CU_JIT_TARGET", {"hipJitOptionTarget", CONV_JIT, API_DRIVER}}, + {"CU_JIT_FALLBACK_STRATEGY", {"hipJitOptionFallbackStrategy", CONV_JIT, API_DRIVER}}, + {"CU_JIT_GENERATE_DEBUG_INFO", {"hipJitOptionGenerateDebugInfo", CONV_JIT, API_DRIVER}}, + {"CU_JIT_LOG_VERBOSE", {"hipJitOptionLogVerbose", CONV_JIT, API_DRIVER}}, + {"CU_JIT_GENERATE_LINE_INFO", {"hipJitOptionGenerateLineInfo", CONV_JIT, API_DRIVER}}, + {"CU_JIT_CACHE_MODE", {"hipJitOptionCacheMode", CONV_JIT, API_DRIVER}}, + {"CU_JIT_NEW_SM3X_OPT", {"hipJitOptionSm3xOpt", CONV_JIT, API_DRIVER}}, + {"CU_JIT_FAST_COMPILE", {"hipJitOptionFastCompile", CONV_JIT, API_DRIVER}}, + {"CU_JIT_NUM_OPTIONS", {"hipJitOptionNumOptions", CONV_JIT, API_DRIVER}}, // enum CUjit_target/CUjit_target_enum - {"CU_TARGET_COMPUTE_10", {"hipJitTargetCompute10", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_11", {"hipJitTargetCompute11", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_12", {"hipJitTargetCompute12", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_13", {"hipJitTargetCompute13", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_20", {"hipJitTargetCompute20", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_21", {"hipJitTargetCompute21", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_30", {"hipJitTargetCompute30", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_32", {"hipJitTargetCompute32", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_35", {"hipJitTargetCompute35", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_37", {"hipJitTargetCompute37", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_50", {"hipJitTargetCompute50", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_52", {"hipJitTargetCompute52", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_53", {"hipJitTargetCompute53", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_60", {"hipJitTargetCompute60", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_61", {"hipJitTargetCompute61", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_TARGET_COMPUTE_62", {"hipJitTargetCompute62", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_10", {"hipJitTargetCompute10", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_11", {"hipJitTargetCompute11", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_12", {"hipJitTargetCompute12", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_13", {"hipJitTargetCompute13", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_20", {"hipJitTargetCompute20", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_21", {"hipJitTargetCompute21", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_30", {"hipJitTargetCompute30", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_32", {"hipJitTargetCompute32", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_35", {"hipJitTargetCompute35", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_37", {"hipJitTargetCompute37", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_50", {"hipJitTargetCompute50", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_52", {"hipJitTargetCompute52", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_53", {"hipJitTargetCompute53", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_60", {"hipJitTargetCompute60", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_61", {"hipJitTargetCompute61", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_TARGET_COMPUTE_62", {"hipJitTargetCompute62", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, // enum CUjitInputType/CUjitInputType_enum - {"CU_JIT_INPUT_CUBIN", {"hipJitInputTypeBin", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_JIT_INPUT_PTX", {"hipJitInputTypePtx", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_JIT_INPUT_FATBINARY", {"hipJitInputTypeFatBinary", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_JIT_INPUT_OBJECT", {"hipJitInputTypeObject", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_JIT_INPUT_LIBRARY", {"hipJitInputTypeLibrary", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, - {"CU_JIT_NUM_INPUT_TYPES", {"hipJitInputTypeNumInputTypes", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_JIT_INPUT_CUBIN", {"hipJitInputTypeBin", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_JIT_INPUT_PTX", {"hipJitInputTypePtx", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_JIT_INPUT_FATBINARY", {"hipJitInputTypeFatBinary", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_JIT_INPUT_OBJECT", {"hipJitInputTypeObject", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_JIT_INPUT_LIBRARY", {"hipJitInputTypeLibrary", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, + {"CU_JIT_NUM_INPUT_TYPES", + {"hipJitInputTypeNumInputTypes", CONV_JIT, API_DRIVER, HIP_UNSUPPORTED}}, // enum CUlimit/CUlimit_enum - {"CU_LIMIT_STACK_SIZE", {"hipLimitStackSize", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaLimitStackSize = 0x00) - {"CU_LIMIT_PRINTF_FIFO_SIZE", {"hipLimitPrintfFifoSize", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaLimitPrintfFifoSize = 0x01) - {"CU_LIMIT_MALLOC_HEAP_SIZE", {"hipLimitMallocHeapSize", CONV_TYPE, API_DRIVER}}, // 0x02 // API_Runtime ANALOGUE (cudaLimitMallocHeapSize = 0x02) - {"CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH", {"hipLimitDevRuntimeSyncDepth", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaLimitDevRuntimeSyncDepth = 0x03) - {"CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT", {"hipLimitDevRuntimePendingLaunchCount", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 // API_Runtime ANALOGUE (cudaLimitDevRuntimePendingLaunchCount = 0x04) - {"CU_LIMIT_STACK_SIZE", {"hipLimitStackSize", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) + {"CU_LIMIT_STACK_SIZE", + {"hipLimitStackSize", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaLimitStackSize = 0x00) + {"CU_LIMIT_PRINTF_FIFO_SIZE", + {"hipLimitPrintfFifoSize", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaLimitPrintfFifoSize = 0x01) + {"CU_LIMIT_MALLOC_HEAP_SIZE", + {"hipLimitMallocHeapSize", CONV_TYPE, + API_DRIVER}}, // 0x02 // API_Runtime ANALOGUE (cudaLimitMallocHeapSize = 0x02) + {"CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH", + {"hipLimitDevRuntimeSyncDepth", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaLimitDevRuntimeSyncDepth = 0x03) + {"CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT", + {"hipLimitDevRuntimePendingLaunchCount", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x04 // API_Runtime ANALOGUE (cudaLimitDevRuntimePendingLaunchCount = + // 0x04) + {"CU_LIMIT_STACK_SIZE", + {"hipLimitStackSize", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (no) // enum CUmemAttach_flags/CUmemAttach_flags_enum - {"CU_MEM_ATTACH_GLOBAL", {"hipMemAttachGlobal", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x1 // API_Runtime ANALOGUE (#define cudaMemAttachGlobal 0x01) - {"CU_MEM_ATTACH_HOST", {"hipMemAttachHost", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x2 // API_Runtime ANALOGUE (#define cudaMemAttachHost 0x02) - {"CU_MEM_ATTACH_SINGLE", {"hipMemAttachSingle", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x4 // API_Runtime ANALOGUE (#define cudaMemAttachSingle 0x04) + {"CU_MEM_ATTACH_GLOBAL", + {"hipMemAttachGlobal", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x1 // API_Runtime ANALOGUE (#define cudaMemAttachGlobal 0x01) + {"CU_MEM_ATTACH_HOST", + {"hipMemAttachHost", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x2 // API_Runtime ANALOGUE (#define cudaMemAttachHost 0x02) + {"CU_MEM_ATTACH_SINGLE", + {"hipMemAttachSingle", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x4 // API_Runtime ANALOGUE (#define cudaMemAttachSingle 0x04) // enum CUmemorytype/CUmemorytype_enum - {"CU_MEMORYTYPE_HOST", {"hipMemTypeHost", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (no) - {"CU_MEMORYTYPE_DEVICE", {"hipMemTypeDevice", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (no) - {"CU_MEMORYTYPE_ARRAY", {"hipMemTypeArray", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (no) - {"CU_MEMORYTYPE_UNIFIED", {"hipMemTypeUnified", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x04 // API_Runtime ANALOGUE (no) + {"CU_MEMORYTYPE_HOST", + {"hipMemTypeHost", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (no) + {"CU_MEMORYTYPE_DEVICE", + {"hipMemTypeDevice", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (no) + {"CU_MEMORYTYPE_ARRAY", + {"hipMemTypeArray", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (no) + {"CU_MEMORYTYPE_UNIFIED", + {"hipMemTypeUnified", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x04 // API_Runtime ANALOGUE (no) // enum CUresourcetype/CUresourcetype_enum - {"CU_RESOURCE_TYPE_ARRAY", {"hipResourceTypeArray", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaResourceTypeArray = 0x00) - {"CU_RESOURCE_TYPE_MIPMAPPED_ARRAY", {"hipResourceTypeMipmappedArray", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaResourceTypeMipmappedArray = 0x01) - {"CU_RESOURCE_TYPE_LINEAR", {"hipResourceTypeLinear", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaResourceTypeLinear = 0x02) - {"CU_RESOURCE_TYPE_PITCH2D", {"hipResourceTypePitch2D", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaResourceTypePitch2D = 0x03) + {"CU_RESOURCE_TYPE_ARRAY", + {"hipResourceTypeArray", CONV_TEX, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaResourceTypeArray = 0x00) + {"CU_RESOURCE_TYPE_MIPMAPPED_ARRAY", + {"hipResourceTypeMipmappedArray", CONV_TEX, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaResourceTypeMipmappedArray = 0x01) + {"CU_RESOURCE_TYPE_LINEAR", + {"hipResourceTypeLinear", CONV_TEX, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaResourceTypeLinear = 0x02) + {"CU_RESOURCE_TYPE_PITCH2D", + {"hipResourceTypePitch2D", CONV_TEX, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaResourceTypePitch2D = 0x03) // enum CUresourceViewFormat/CUresourceViewFormat_enum - {"CU_RES_VIEW_FORMAT_NONE", {"hipResViewFormatNone", CONV_TEX, API_DRIVER}}, // 0x00 // API_Runtime ANALOGUE (cudaResViewFormatNone = 0x00) - {"CU_RES_VIEW_FORMAT_UINT_1X8", {"hipResViewFormatUnsignedChar1", CONV_TEX, API_DRIVER}}, // 0x01 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedChar1 = 0x01) - {"CU_RES_VIEW_FORMAT_UINT_2X8", {"hipResViewFormatUnsignedChar2", CONV_TEX, API_DRIVER}}, // 0x02 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedChar2 = 0x02) - {"CU_RES_VIEW_FORMAT_UINT_4X8", {"hipResViewFormatUnsignedChar4", CONV_TEX, API_DRIVER}}, // 0x03 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedChar4 = 0x03) - {"CU_RES_VIEW_FORMAT_SINT_1X8", {"hipResViewFormatSignedChar1", CONV_TEX, API_DRIVER}}, // 0x04 // API_Runtime ANALOGUE (cudaResViewFormatSignedChar1 = 0x04) - {"CU_RES_VIEW_FORMAT_SINT_2X8", {"hipResViewFormatSignedChar2", CONV_TEX, API_DRIVER}}, // 0x05 // API_Runtime ANALOGUE (cudaResViewFormatSignedChar2 = 0x05) - {"CU_RES_VIEW_FORMAT_SINT_4X8", {"hipResViewFormatSignedChar4", CONV_TEX, API_DRIVER}}, // 0x06 // API_Runtime ANALOGUE (cudaResViewFormatSignedChar4 = 0x06) - {"CU_RES_VIEW_FORMAT_UINT_1X16", {"hipResViewFormatUnsignedShort1", CONV_TEX, API_DRIVER}}, // 0x07 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedShort1 = 0x07) - {"CU_RES_VIEW_FORMAT_UINT_2X16", {"hipResViewFormatUnsignedShort2", CONV_TEX, API_DRIVER}}, // 0x08 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedShort2 = 0x08) - {"CU_RES_VIEW_FORMAT_UINT_4X16", {"hipResViewFormatUnsignedShort4", CONV_TEX, API_DRIVER}}, // 0x09 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedShort4 = 0x09) - {"CU_RES_VIEW_FORMAT_SINT_1X16", {"hipResViewFormatSignedShort1", CONV_TEX, API_DRIVER}}, // 0x0a // API_Runtime ANALOGUE (cudaResViewFormatSignedShort1 = 0x0a) - {"CU_RES_VIEW_FORMAT_SINT_2X16", {"hipResViewFormatSignedShort2", CONV_TEX, API_DRIVER}}, // 0x0b // API_Runtime ANALOGUE (cudaResViewFormatSignedShort2 = 0x0b) - {"CU_RES_VIEW_FORMAT_SINT_4X16", {"hipResViewFormatSignedShort4", CONV_TEX, API_DRIVER}}, // 0x0c // API_Runtime ANALOGUE (cudaResViewFormatSignedShort4 = 0x0c) - {"CU_RES_VIEW_FORMAT_UINT_1X32", {"hipResViewFormatUnsignedInt1", CONV_TEX, API_DRIVER}}, // 0x0d // API_Runtime ANALOGUE (cudaResViewFormatUnsignedInt1 = 0x0d) - {"CU_RES_VIEW_FORMAT_UINT_2X32", {"hipResViewFormatUnsignedInt2", CONV_TEX, API_DRIVER}}, // 0x0e // API_Runtime ANALOGUE (cudaResViewFormatUnsignedInt2 = 0x0e) - {"CU_RES_VIEW_FORMAT_UINT_4X32", {"hipResViewFormatUnsignedInt4", CONV_TEX, API_DRIVER}}, // 0x0f // API_Runtime ANALOGUE (cudaResViewFormatUnsignedInt4 = 0x0f) - {"CU_RES_VIEW_FORMAT_SINT_1X32", {"hipResViewFormatSignedInt1", CONV_TEX, API_DRIVER}}, // 0x10 // API_Runtime ANALOGUE (cudaResViewFormatSignedInt1 = 0x10) - {"CU_RES_VIEW_FORMAT_SINT_2X32", {"hipResViewFormatSignedInt2", CONV_TEX, API_DRIVER}}, // 0x11 // API_Runtime ANALOGUE (cudaResViewFormatSignedInt2 = 0x11) - {"CU_RES_VIEW_FORMAT_SINT_4X32", {"hipResViewFormatSignedInt4", CONV_TEX, API_DRIVER}}, // 0x12 // API_Runtime ANALOGUE (cudaResViewFormatSignedInt4 = 0x12) - {"CU_RES_VIEW_FORMAT_FLOAT_1X16", {"hipResViewFormatHalf1", CONV_TEX, API_DRIVER}}, // 0x13 // API_Runtime ANALOGUE (cudaResViewFormatHalf1 = 0x13) - {"CU_RES_VIEW_FORMAT_FLOAT_2X16", {"hipResViewFormatHalf2", CONV_TEX, API_DRIVER}}, // 0x14 // API_Runtime ANALOGUE (cudaResViewFormatHalf2 = 0x14) - {"CU_RES_VIEW_FORMAT_FLOAT_4X16", {"hipResViewFormatHalf4", CONV_TEX, API_DRIVER}}, // 0x15 // API_Runtime ANALOGUE (cudaResViewFormatHalf4 = 0x15) - {"CU_RES_VIEW_FORMAT_FLOAT_1X32", {"hipResViewFormatFloat1", CONV_TEX, API_DRIVER}}, // 0x16 // API_Runtime ANALOGUE (cudaResViewFormatFloat1 = 0x16) - {"CU_RES_VIEW_FORMAT_FLOAT_2X32", {"hipResViewFormatFloat2", CONV_TEX, API_DRIVER}}, // 0x17 // API_Runtime ANALOGUE (cudaResViewFormatFloat2 = 0x17) - {"CU_RES_VIEW_FORMAT_FLOAT_4X32", {"hipResViewFormatFloat4", CONV_TEX, API_DRIVER}}, // 0x18 // API_Runtime ANALOGUE (cudaResViewFormatFloat4 = 0x18) - {"CU_RES_VIEW_FORMAT_UNSIGNED_BC1", {"hipResViewFormatUnsignedBlockCompressed1", CONV_TEX, API_DRIVER}}, // 0x19 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed1 = 0x19) - {"CU_RES_VIEW_FORMAT_UNSIGNED_BC2", {"hipResViewFormatUnsignedBlockCompressed2", CONV_TEX, API_DRIVER}}, // 0x1a // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed2 = 0x1a) - {"CU_RES_VIEW_FORMAT_UNSIGNED_BC3", {"hipResViewFormatUnsignedBlockCompressed3", CONV_TEX, API_DRIVER}}, // 0x1b // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed3 = 0x1b) - {"CU_RES_VIEW_FORMAT_UNSIGNED_BC4", {"hipResViewFormatUnsignedBlockCompressed4", CONV_TEX, API_DRIVER}}, // 0x1c // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed4 = 0x1c) - {"CU_RES_VIEW_FORMAT_SIGNED_BC4", {"hipResViewFormatSignedBlockCompressed4", CONV_TEX, API_DRIVER}}, // 0x1d // API_Runtime ANALOGUE (cudaResViewFormatSignedBlockCompressed4 = 0x1d) - {"CU_RES_VIEW_FORMAT_UNSIGNED_BC5", {"hipResViewFormatUnsignedBlockCompressed5", CONV_TEX, API_DRIVER}}, // 0x1e // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed5 = 0x1e) - {"CU_RES_VIEW_FORMAT_SIGNED_BC5", {"hipResViewFormatSignedBlockCompressed5", CONV_TEX, API_DRIVER}}, // 0x1f // API_Runtime ANALOGUE (cudaResViewFormatSignedBlockCompressed5 = 0x1f) - {"CU_RES_VIEW_FORMAT_UNSIGNED_BC6H", {"hipResViewFormatUnsignedBlockCompressed6H", CONV_TEX, API_DRIVER}}, // 0x20 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed6H = 0x20) - {"CU_RES_VIEW_FORMAT_SIGNED_BC6H", {"hipResViewFormatSignedBlockCompressed6H", CONV_TEX, API_DRIVER}}, // 0x21 // API_Runtime ANALOGUE (cudaResViewFormatSignedBlockCompressed6H = 0x21) - {"CU_RES_VIEW_FORMAT_UNSIGNED_BC7", {"hipResViewFormatUnsignedBlockCompressed7", CONV_TEX, API_DRIVER}}, // 0x22 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed7 = 0x22) + {"CU_RES_VIEW_FORMAT_NONE", + {"hipResViewFormatNone", CONV_TEX, + API_DRIVER}}, // 0x00 // API_Runtime ANALOGUE (cudaResViewFormatNone = 0x00) + {"CU_RES_VIEW_FORMAT_UINT_1X8", + {"hipResViewFormatUnsignedChar1", CONV_TEX, + API_DRIVER}}, // 0x01 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedChar1 = 0x01) + {"CU_RES_VIEW_FORMAT_UINT_2X8", + {"hipResViewFormatUnsignedChar2", CONV_TEX, + API_DRIVER}}, // 0x02 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedChar2 = 0x02) + {"CU_RES_VIEW_FORMAT_UINT_4X8", + {"hipResViewFormatUnsignedChar4", CONV_TEX, + API_DRIVER}}, // 0x03 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedChar4 = 0x03) + {"CU_RES_VIEW_FORMAT_SINT_1X8", + {"hipResViewFormatSignedChar1", CONV_TEX, + API_DRIVER}}, // 0x04 // API_Runtime ANALOGUE (cudaResViewFormatSignedChar1 = 0x04) + {"CU_RES_VIEW_FORMAT_SINT_2X8", + {"hipResViewFormatSignedChar2", CONV_TEX, + API_DRIVER}}, // 0x05 // API_Runtime ANALOGUE (cudaResViewFormatSignedChar2 = 0x05) + {"CU_RES_VIEW_FORMAT_SINT_4X8", + {"hipResViewFormatSignedChar4", CONV_TEX, + API_DRIVER}}, // 0x06 // API_Runtime ANALOGUE (cudaResViewFormatSignedChar4 = 0x06) + {"CU_RES_VIEW_FORMAT_UINT_1X16", + {"hipResViewFormatUnsignedShort1", CONV_TEX, + API_DRIVER}}, // 0x07 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedShort1 = 0x07) + {"CU_RES_VIEW_FORMAT_UINT_2X16", + {"hipResViewFormatUnsignedShort2", CONV_TEX, + API_DRIVER}}, // 0x08 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedShort2 = 0x08) + {"CU_RES_VIEW_FORMAT_UINT_4X16", + {"hipResViewFormatUnsignedShort4", CONV_TEX, + API_DRIVER}}, // 0x09 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedShort4 = 0x09) + {"CU_RES_VIEW_FORMAT_SINT_1X16", + {"hipResViewFormatSignedShort1", CONV_TEX, + API_DRIVER}}, // 0x0a // API_Runtime ANALOGUE (cudaResViewFormatSignedShort1 = 0x0a) + {"CU_RES_VIEW_FORMAT_SINT_2X16", + {"hipResViewFormatSignedShort2", CONV_TEX, + API_DRIVER}}, // 0x0b // API_Runtime ANALOGUE (cudaResViewFormatSignedShort2 = 0x0b) + {"CU_RES_VIEW_FORMAT_SINT_4X16", + {"hipResViewFormatSignedShort4", CONV_TEX, + API_DRIVER}}, // 0x0c // API_Runtime ANALOGUE (cudaResViewFormatSignedShort4 = 0x0c) + {"CU_RES_VIEW_FORMAT_UINT_1X32", + {"hipResViewFormatUnsignedInt1", CONV_TEX, + API_DRIVER}}, // 0x0d // API_Runtime ANALOGUE (cudaResViewFormatUnsignedInt1 = 0x0d) + {"CU_RES_VIEW_FORMAT_UINT_2X32", + {"hipResViewFormatUnsignedInt2", CONV_TEX, + API_DRIVER}}, // 0x0e // API_Runtime ANALOGUE (cudaResViewFormatUnsignedInt2 = 0x0e) + {"CU_RES_VIEW_FORMAT_UINT_4X32", + {"hipResViewFormatUnsignedInt4", CONV_TEX, + API_DRIVER}}, // 0x0f // API_Runtime ANALOGUE (cudaResViewFormatUnsignedInt4 = 0x0f) + {"CU_RES_VIEW_FORMAT_SINT_1X32", + {"hipResViewFormatSignedInt1", CONV_TEX, + API_DRIVER}}, // 0x10 // API_Runtime ANALOGUE (cudaResViewFormatSignedInt1 = 0x10) + {"CU_RES_VIEW_FORMAT_SINT_2X32", + {"hipResViewFormatSignedInt2", CONV_TEX, + API_DRIVER}}, // 0x11 // API_Runtime ANALOGUE (cudaResViewFormatSignedInt2 = 0x11) + {"CU_RES_VIEW_FORMAT_SINT_4X32", + {"hipResViewFormatSignedInt4", CONV_TEX, + API_DRIVER}}, // 0x12 // API_Runtime ANALOGUE (cudaResViewFormatSignedInt4 = 0x12) + {"CU_RES_VIEW_FORMAT_FLOAT_1X16", + {"hipResViewFormatHalf1", CONV_TEX, + API_DRIVER}}, // 0x13 // API_Runtime ANALOGUE (cudaResViewFormatHalf1 = 0x13) + {"CU_RES_VIEW_FORMAT_FLOAT_2X16", + {"hipResViewFormatHalf2", CONV_TEX, + API_DRIVER}}, // 0x14 // API_Runtime ANALOGUE (cudaResViewFormatHalf2 = 0x14) + {"CU_RES_VIEW_FORMAT_FLOAT_4X16", + {"hipResViewFormatHalf4", CONV_TEX, + API_DRIVER}}, // 0x15 // API_Runtime ANALOGUE (cudaResViewFormatHalf4 = 0x15) + {"CU_RES_VIEW_FORMAT_FLOAT_1X32", + {"hipResViewFormatFloat1", CONV_TEX, + API_DRIVER}}, // 0x16 // API_Runtime ANALOGUE (cudaResViewFormatFloat1 = 0x16) + {"CU_RES_VIEW_FORMAT_FLOAT_2X32", + {"hipResViewFormatFloat2", CONV_TEX, + API_DRIVER}}, // 0x17 // API_Runtime ANALOGUE (cudaResViewFormatFloat2 = 0x17) + {"CU_RES_VIEW_FORMAT_FLOAT_4X32", + {"hipResViewFormatFloat4", CONV_TEX, + API_DRIVER}}, // 0x18 // API_Runtime ANALOGUE (cudaResViewFormatFloat4 = 0x18) + {"CU_RES_VIEW_FORMAT_UNSIGNED_BC1", + {"hipResViewFormatUnsignedBlockCompressed1", CONV_TEX, + API_DRIVER}}, // 0x19 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed1 = + // 0x19) + {"CU_RES_VIEW_FORMAT_UNSIGNED_BC2", + {"hipResViewFormatUnsignedBlockCompressed2", CONV_TEX, + API_DRIVER}}, // 0x1a // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed2 = + // 0x1a) + {"CU_RES_VIEW_FORMAT_UNSIGNED_BC3", + {"hipResViewFormatUnsignedBlockCompressed3", CONV_TEX, + API_DRIVER}}, // 0x1b // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed3 = + // 0x1b) + {"CU_RES_VIEW_FORMAT_UNSIGNED_BC4", + {"hipResViewFormatUnsignedBlockCompressed4", CONV_TEX, + API_DRIVER}}, // 0x1c // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed4 = + // 0x1c) + {"CU_RES_VIEW_FORMAT_SIGNED_BC4", + {"hipResViewFormatSignedBlockCompressed4", CONV_TEX, + API_DRIVER}}, // 0x1d // API_Runtime ANALOGUE (cudaResViewFormatSignedBlockCompressed4 = + // 0x1d) + {"CU_RES_VIEW_FORMAT_UNSIGNED_BC5", + {"hipResViewFormatUnsignedBlockCompressed5", CONV_TEX, + API_DRIVER}}, // 0x1e // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed5 = + // 0x1e) + {"CU_RES_VIEW_FORMAT_SIGNED_BC5", + {"hipResViewFormatSignedBlockCompressed5", CONV_TEX, + API_DRIVER}}, // 0x1f // API_Runtime ANALOGUE (cudaResViewFormatSignedBlockCompressed5 = + // 0x1f) + {"CU_RES_VIEW_FORMAT_UNSIGNED_BC6H", + {"hipResViewFormatUnsignedBlockCompressed6H", CONV_TEX, + API_DRIVER}}, // 0x20 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed6H = + // 0x20) + {"CU_RES_VIEW_FORMAT_SIGNED_BC6H", + {"hipResViewFormatSignedBlockCompressed6H", CONV_TEX, + API_DRIVER}}, // 0x21 // API_Runtime ANALOGUE (cudaResViewFormatSignedBlockCompressed6H = + // 0x21) + {"CU_RES_VIEW_FORMAT_UNSIGNED_BC7", + {"hipResViewFormatUnsignedBlockCompressed7", CONV_TEX, + API_DRIVER}}, // 0x22 // API_Runtime ANALOGUE (cudaResViewFormatUnsignedBlockCompressed7 = + // 0x22) - {"CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE", {"hipSharedMemBankSizeDefault", CONV_TYPE, API_DRIVER}}, - {"CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE", {"hipSharedMemBankSizeFourByte", CONV_TYPE, API_DRIVER}}, - {"CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE", {"hipSharedMemBankSizeEightByte", CONV_TYPE, API_DRIVER}}, + {"CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE", + {"hipSharedMemBankSizeDefault", CONV_TYPE, API_DRIVER}}, + {"CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE", + {"hipSharedMemBankSizeFourByte", CONV_TYPE, API_DRIVER}}, + {"CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE", + {"hipSharedMemBankSizeEightByte", CONV_TYPE, API_DRIVER}}, // enum CUstream_flags/CUstream_flags_enum - {"CU_STREAM_DEFAULT", {"hipStreamDefault", CONV_TYPE, API_DRIVER}}, - {"CU_STREAM_NON_BLOCKING", {"hipStreamNonBlocking", CONV_TYPE, API_DRIVER}}, + {"CU_STREAM_DEFAULT", {"hipStreamDefault", CONV_TYPE, API_DRIVER}}, + {"CU_STREAM_NON_BLOCKING", {"hipStreamNonBlocking", CONV_TYPE, API_DRIVER}}, // Flags for ::cuStreamWaitValue32 (enum CUstreamWaitValue_flags/CUstreamWaitValue_flags_enum) - {"CU_STREAM_WAIT_VALUE_GEQ", {"hipStreamWaitValueGeq", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x0 - {"CU_STREAM_WAIT_VALUE_EQ", {"hipStreamWaitValueEq", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x1 - {"CU_STREAM_WAIT_VALUE_AND", {"hipStreamWaitValueAnd", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x2 - {"CU_STREAM_WAIT_VALUE_FLUSH", {"hipStreamWaitValueFlush", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 1<<30 + {"CU_STREAM_WAIT_VALUE_GEQ", + {"hipStreamWaitValueGeq", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x0 + {"CU_STREAM_WAIT_VALUE_EQ", + {"hipStreamWaitValueEq", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x1 + {"CU_STREAM_WAIT_VALUE_AND", + {"hipStreamWaitValueAnd", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x2 + {"CU_STREAM_WAIT_VALUE_FLUSH", + {"hipStreamWaitValueFlush", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 1<<30 - // Flags for ::cuStreamWriteValue32 (enum CUstreamWriteValue_flags/CUstreamWriteValue_flags_enum) - {"CU_STREAM_WRITE_VALUE_DEFAULT", {"hipStreamWriteValueDefault", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x0 - {"CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER", {"hipStreamWriteValueNoMemoryBarrier", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x1 + // Flags for ::cuStreamWriteValue32 (enum + // CUstreamWriteValue_flags/CUstreamWriteValue_flags_enum) + {"CU_STREAM_WRITE_VALUE_DEFAULT", + {"hipStreamWriteValueDefault", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x0 + {"CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER", + {"hipStreamWriteValueNoMemoryBarrier", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x1 // Flags for ::cuStreamBatchMemOp (enum CUstreamBatchMemOpType/CUstreamBatchMemOpType_enum) - {"CU_STREAM_MEM_OP_WAIT_VALUE_32", {"hipStreamBatchMemOpWaitValue32", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 1 - {"CU_STREAM_MEM_OP_WRITE_VALUE_32", {"hipStreamBatchMemOpWriteValue32", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 2 - {"CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES", {"hipStreamBatchMemOpFlushRemoteWrites", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 3 + {"CU_STREAM_MEM_OP_WAIT_VALUE_32", + {"hipStreamBatchMemOpWaitValue32", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 1 + {"CU_STREAM_MEM_OP_WRITE_VALUE_32", + {"hipStreamBatchMemOpWriteValue32", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 2 + {"CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES", + {"hipStreamBatchMemOpFlushRemoteWrites", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 3 // Error Handling - {"cuGetErrorName", {"hipGetErrorName___", CONV_ERROR, API_DRIVER, HIP_UNSUPPORTED}}, // cudaGetErrorName (hipGetErrorName) has different signature - {"cuGetErrorString", {"hipGetErrorString___", CONV_ERROR, API_DRIVER, HIP_UNSUPPORTED}}, // cudaGetErrorString (hipGetErrorString) has different signature + {"cuGetErrorName", + {"hipGetErrorName___", CONV_ERROR, API_DRIVER, + HIP_UNSUPPORTED}}, // cudaGetErrorName (hipGetErrorName) has different signature + {"cuGetErrorString", + {"hipGetErrorString___", CONV_ERROR, API_DRIVER, + HIP_UNSUPPORTED}}, // cudaGetErrorString (hipGetErrorString) has different signature // Init {"cuInit", {"hipInit", CONV_INIT, API_DRIVER}}, @@ -1001,1884 +1693,2877 @@ const std::map CUDA_IDENTIFIER_MAP{ {"cuDriverGetVersion", {"hipDriverGetVersion", CONV_VERSION, API_DRIVER}}, // Context Management - {"cuCtxCreate_v2", {"hipCtxCreate", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxDestroy_v2", {"hipCtxDestroy", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxGetApiVersion", {"hipCtxGetApiVersion", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxGetCacheConfig", {"hipCtxGetCacheConfig", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxGetCurrent", {"hipCtxGetCurrent", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxGetDevice", {"hipCtxGetDevice", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxGetFlags", {"hipCtxGetFlags", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxGetLimit", {"hipCtxGetLimit", CONV_CONTEXT, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuCtxGetSharedMemConfig", {"hipCtxGetSharedMemConfig", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxGetStreamPriorityRange", {"hipCtxGetStreamPriorityRange", CONV_CONTEXT, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuCtxPopCurrent_v2", {"hipCtxPopCurrent", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxPushCurrent_v2", {"hipCtxPushCurrent", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxSetCacheConfig", {"hipCtxSetCacheConfig", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxSetCurrent", {"hipCtxSetCurrent", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxSetLimit", {"hipCtxSetLimit", CONV_CONTEXT, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuCtxSetSharedMemConfig", {"hipCtxSetSharedMemConfig", CONV_CONTEXT, API_DRIVER}}, - {"cuCtxSynchronize", {"hipCtxSynchronize", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxCreate_v2", {"hipCtxCreate", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxDestroy_v2", {"hipCtxDestroy", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxGetApiVersion", {"hipCtxGetApiVersion", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxGetCacheConfig", {"hipCtxGetCacheConfig", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxGetCurrent", {"hipCtxGetCurrent", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxGetDevice", {"hipCtxGetDevice", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxGetFlags", {"hipCtxGetFlags", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxGetLimit", {"hipCtxGetLimit", CONV_CONTEXT, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuCtxGetSharedMemConfig", {"hipCtxGetSharedMemConfig", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxGetStreamPriorityRange", + {"hipCtxGetStreamPriorityRange", CONV_CONTEXT, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuCtxPopCurrent_v2", {"hipCtxPopCurrent", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxPushCurrent_v2", {"hipCtxPushCurrent", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxSetCacheConfig", {"hipCtxSetCacheConfig", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxSetCurrent", {"hipCtxSetCurrent", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxSetLimit", {"hipCtxSetLimit", CONV_CONTEXT, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuCtxSetSharedMemConfig", {"hipCtxSetSharedMemConfig", CONV_CONTEXT, API_DRIVER}}, + {"cuCtxSynchronize", {"hipCtxSynchronize", CONV_CONTEXT, API_DRIVER}}, // Context Management [DEPRECATED] - {"cuCtxAttach", {"hipCtxAttach", CONV_CONTEXT, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuCtxDetach", {"hipCtxDetach", CONV_CONTEXT, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuCtxAttach", {"hipCtxAttach", CONV_CONTEXT, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuCtxDetach", {"hipCtxDetach", CONV_CONTEXT, API_DRIVER, HIP_UNSUPPORTED}}, // Peer Context Memory Access - {"cuCtxEnablePeerAccess", {"hipCtxEnablePeerAccess", CONV_PEER, API_DRIVER}}, - {"cuCtxDisablePeerAccess", {"hipCtxDisablePeerAccess", CONV_PEER, API_DRIVER}}, - {"cuDeviceCanAccessPeer", {"hipDeviceCanAccessPeer", CONV_PEER, API_DRIVER}}, - {"cuDeviceGetP2PAttribute", {"hipDeviceGetP2PAttribute", CONV_PEER, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaDeviceGetP2PAttribute) + {"cuCtxEnablePeerAccess", {"hipCtxEnablePeerAccess", CONV_PEER, API_DRIVER}}, + {"cuCtxDisablePeerAccess", {"hipCtxDisablePeerAccess", CONV_PEER, API_DRIVER}}, + {"cuDeviceCanAccessPeer", {"hipDeviceCanAccessPeer", CONV_PEER, API_DRIVER}}, + {"cuDeviceGetP2PAttribute", + {"hipDeviceGetP2PAttribute", CONV_PEER, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaDeviceGetP2PAttribute) // Primary Context Management {"cuDevicePrimaryCtxGetState", {"hipDevicePrimaryCtxGetState", CONV_CONTEXT, API_DRIVER}}, - {"cuDevicePrimaryCtxRelease", {"hipDevicePrimaryCtxRelease", CONV_CONTEXT, API_DRIVER}}, - {"cuDevicePrimaryCtxReset", {"hipDevicePrimaryCtxReset", CONV_CONTEXT, API_DRIVER}}, - {"cuDevicePrimaryCtxRetain", {"hipDevicePrimaryCtxRetain", CONV_CONTEXT, API_DRIVER}}, + {"cuDevicePrimaryCtxRelease", {"hipDevicePrimaryCtxRelease", CONV_CONTEXT, API_DRIVER}}, + {"cuDevicePrimaryCtxReset", {"hipDevicePrimaryCtxReset", CONV_CONTEXT, API_DRIVER}}, + {"cuDevicePrimaryCtxRetain", {"hipDevicePrimaryCtxRetain", CONV_CONTEXT, API_DRIVER}}, {"cuDevicePrimaryCtxSetFlags", {"hipDevicePrimaryCtxSetFlags", CONV_CONTEXT, API_DRIVER}}, // Device Management - {"cuDeviceGet", {"hipGetDevice", CONV_DEVICE, API_DRIVER}}, - {"cuDeviceGetName", {"hipDeviceGetName", CONV_DEVICE, API_DRIVER}}, - {"cuDeviceGetCount", {"hipGetDeviceCount", CONV_DEVICE, API_DRIVER}}, - {"cuDeviceGetAttribute", {"hipDeviceGetAttribute", CONV_DEVICE, API_DRIVER}}, - {"cuDeviceGetPCIBusId", {"hipDeviceGetPCIBusId", CONV_DEVICE, API_DRIVER}}, + {"cuDeviceGet", {"hipGetDevice", CONV_DEVICE, API_DRIVER}}, + {"cuDeviceGetName", {"hipDeviceGetName", CONV_DEVICE, API_DRIVER}}, + {"cuDeviceGetCount", {"hipGetDeviceCount", CONV_DEVICE, API_DRIVER}}, + {"cuDeviceGetAttribute", {"hipDeviceGetAttribute", CONV_DEVICE, API_DRIVER}}, + {"cuDeviceGetPCIBusId", {"hipDeviceGetPCIBusId", CONV_DEVICE, API_DRIVER}}, {"cuDeviceGetByPCIBusId", {"hipDeviceGetByPCIBusId", CONV_DEVICE, API_DRIVER}}, - {"cuDeviceTotalMem_v2", {"hipDeviceTotalMem", CONV_DEVICE, API_DRIVER}}, + {"cuDeviceTotalMem_v2", {"hipDeviceTotalMem", CONV_DEVICE, API_DRIVER}}, // Device Management [DEPRECATED] {"cuDeviceComputeCapability", {"hipDeviceComputeCapability", CONV_DEVICE, API_DRIVER}}, - {"cuDeviceGetProperties", {"hipGetDeviceProperties", CONV_DEVICE, API_DRIVER}}, + {"cuDeviceGetProperties", {"hipGetDeviceProperties", CONV_DEVICE, API_DRIVER}}, // Module Management - {"cuLinkAddData", {"hipLinkAddData", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuLinkAddFile", {"hipLinkAddFile", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuLinkComplete", {"hipLinkComplete", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuLinkCreate", {"hipLinkCreate", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuLinkDestroy", {"hipLinkDestroy", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuModuleGetFunction", {"hipModuleGetFunction", CONV_MODULE, API_DRIVER}}, - {"cuModuleGetGlobal_v2", {"hipModuleGetGlobal", CONV_MODULE, API_DRIVER}}, - {"cuModuleGetSurfRef", {"hipModuleGetSurfRef", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuModuleGetTexRef", {"hipModuleGetTexRef", CONV_MODULE, API_DRIVER}}, - {"cuModuleLoad", {"hipModuleLoad", CONV_MODULE, API_DRIVER}}, - {"cuModuleLoadData", {"hipModuleLoadData", CONV_MODULE, API_DRIVER}}, - {"cuModuleLoadDataEx", {"hipModuleLoadDataEx", CONV_MODULE, API_DRIVER}}, + {"cuLinkAddData", {"hipLinkAddData", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuLinkAddFile", {"hipLinkAddFile", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuLinkComplete", {"hipLinkComplete", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuLinkCreate", {"hipLinkCreate", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuLinkDestroy", {"hipLinkDestroy", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuModuleGetFunction", {"hipModuleGetFunction", CONV_MODULE, API_DRIVER}}, + {"cuModuleGetGlobal_v2", {"hipModuleGetGlobal", CONV_MODULE, API_DRIVER}}, + {"cuModuleGetSurfRef", {"hipModuleGetSurfRef", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuModuleGetTexRef", {"hipModuleGetTexRef", CONV_MODULE, API_DRIVER}}, + {"cuModuleLoad", {"hipModuleLoad", CONV_MODULE, API_DRIVER}}, + {"cuModuleLoadData", {"hipModuleLoadData", CONV_MODULE, API_DRIVER}}, + {"cuModuleLoadDataEx", {"hipModuleLoadDataEx", CONV_MODULE, API_DRIVER}}, {"cuModuleLoadFatBinary", {"hipModuleLoadFatBinary", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuModuleUnload", {"hipModuleUnload", CONV_MODULE, API_DRIVER}}, + {"cuModuleUnload", {"hipModuleUnload", CONV_MODULE, API_DRIVER}}, // enum CUdevice_P2PAttribute/CUdevice_P2PAttribute_enum - {"CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK", {"hipDeviceP2PAttributePerformanceRank", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaDevP2PAttrPerformanceRank = 0x01) - {"CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED", {"hipDeviceP2PAttributeAccessSupported", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaDevP2PAttrAccessSupported = 0x02) - {"CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED", {"hipDeviceP2PAttributeNativeAtomicSupported", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaDevP2PAttrNativeAtomicSupported = 0x03) + {"CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK", + {"hipDeviceP2PAttributePerformanceRank", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaDevP2PAttrPerformanceRank = 0x01) + {"CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED", + {"hipDeviceP2PAttributeAccessSupported", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaDevP2PAttrAccessSupported = 0x02) + {"CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED", + {"hipDeviceP2PAttributeNativeAtomicSupported", CONV_TYPE, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaDevP2PAttrNativeAtomicSupported = + // 0x03) // Events - {"CU_EVENT_DEFAULT", {"hipEventDefault", CONV_EVENT, API_DRIVER}}, - {"CU_EVENT_BLOCKING_SYNC", {"hipEventBlockingSync", CONV_EVENT, API_DRIVER}}, + {"CU_EVENT_DEFAULT", {"hipEventDefault", CONV_EVENT, API_DRIVER}}, + {"CU_EVENT_BLOCKING_SYNC", {"hipEventBlockingSync", CONV_EVENT, API_DRIVER}}, {"CU_EVENT_DISABLE_TIMING", {"hipEventDisableTiming", CONV_EVENT, API_DRIVER}}, - {"CU_EVENT_INTERPROCESS", {"hipEventInterprocess", CONV_EVENT, API_DRIVER}}, + {"CU_EVENT_INTERPROCESS", {"hipEventInterprocess", CONV_EVENT, API_DRIVER}}, // Event functions - {"cuEventCreate", {"hipEventCreate", CONV_EVENT, API_DRIVER}}, - {"cuEventDestroy_v2", {"hipEventDestroy", CONV_EVENT, API_DRIVER}}, - {"cuEventElapsedTime", {"hipEventElapsedTime", CONV_EVENT, API_DRIVER}}, - {"cuEventQuery", {"hipEventQuery", CONV_EVENT, API_DRIVER}}, - {"cuEventRecord", {"hipEventRecord", CONV_EVENT, API_DRIVER}}, - {"cuEventSynchronize", {"hipEventSynchronize", CONV_EVENT, API_DRIVER}}, + {"cuEventCreate", {"hipEventCreate", CONV_EVENT, API_DRIVER}}, + {"cuEventDestroy_v2", {"hipEventDestroy", CONV_EVENT, API_DRIVER}}, + {"cuEventElapsedTime", {"hipEventElapsedTime", CONV_EVENT, API_DRIVER}}, + {"cuEventQuery", {"hipEventQuery", CONV_EVENT, API_DRIVER}}, + {"cuEventRecord", {"hipEventRecord", CONV_EVENT, API_DRIVER}}, + {"cuEventSynchronize", {"hipEventSynchronize", CONV_EVENT, API_DRIVER}}, // Execution Control - {"cuFuncGetAttribute", {"hipFuncGetAttribute", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuFuncSetCacheConfig", {"hipFuncSetCacheConfig", CONV_MODULE, API_DRIVER}}, - {"cuFuncSetSharedMemConfig", {"hipFuncSetSharedMemConfig", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuLaunchKernel", {"hipModuleLaunchKernel", CONV_MODULE, API_DRIVER}}, + {"cuFuncGetAttribute", {"hipFuncGetAttribute", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuFuncSetCacheConfig", {"hipFuncSetCacheConfig", CONV_MODULE, API_DRIVER}}, + {"cuFuncSetSharedMemConfig", + {"hipFuncSetSharedMemConfig", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuLaunchKernel", {"hipModuleLaunchKernel", CONV_MODULE, API_DRIVER}}, // Execution Control [DEPRECATED] {"cuFuncSetBlockShape", {"hipFuncSetBlockShape", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, {"cuFuncSetSharedSize", {"hipFuncSetSharedSize", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuLaunch", {"hipLaunch", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaLaunch) - {"cuLaunchGrid", {"hipLaunchGrid", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuLaunchGridAsync", {"hipLaunchGridAsync", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuParamSetf", {"hipParamSetf", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuParamSeti", {"hipParamSeti", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuParamSetSize", {"hipParamSetSize", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuParamSetSize", {"hipParamSetSize", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuParamSetv", {"hipParamSetv", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuLaunch", + {"hipLaunch", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaLaunch) + {"cuLaunchGrid", {"hipLaunchGrid", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuLaunchGridAsync", {"hipLaunchGridAsync", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuParamSetf", {"hipParamSetf", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuParamSeti", {"hipParamSeti", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuParamSetSize", {"hipParamSetSize", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuParamSetSize", {"hipParamSetSize", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuParamSetv", {"hipParamSetv", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}}, // Occupancy - {"cuOccupancyMaxActiveBlocksPerMultiprocessor", {"hipOccupancyMaxActiveBlocksPerMultiprocessor", CONV_OCCUPANCY, API_DRIVER}}, // API_Runtime ANALOGUE (cudaOccupancyMaxActiveBlocksPerMultiprocessor) - {"cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", {"hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", CONV_OCCUPANCY, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags) - {"cuOccupancyMaxPotentialBlockSize", {"hipOccupancyMaxPotentialBlockSize", CONV_OCCUPANCY, API_DRIVER}}, // API_Runtime ANALOGUE (cudaOccupancyMaxPotentialBlockSize) - {"cuOccupancyMaxPotentialBlockSizeWithFlags", {"hipOccupancyMaxPotentialBlockSizeWithFlags", CONV_OCCUPANCY, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaOccupancyMaxPotentialBlockSizeWithFlags) + {"cuOccupancyMaxActiveBlocksPerMultiprocessor", + {"hipOccupancyMaxActiveBlocksPerMultiprocessor", CONV_OCCUPANCY, + API_DRIVER}}, // API_Runtime ANALOGUE (cudaOccupancyMaxActiveBlocksPerMultiprocessor) + {"cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", + {"hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", CONV_OCCUPANCY, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE + // (cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags) + {"cuOccupancyMaxPotentialBlockSize", + {"hipOccupancyMaxPotentialBlockSize", CONV_OCCUPANCY, + API_DRIVER}}, // API_Runtime ANALOGUE (cudaOccupancyMaxPotentialBlockSize) + {"cuOccupancyMaxPotentialBlockSizeWithFlags", + {"hipOccupancyMaxPotentialBlockSizeWithFlags", CONV_OCCUPANCY, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaOccupancyMaxPotentialBlockSizeWithFlags) // Streams - {"cuStreamAddCallback", {"hipStreamAddCallback", CONV_STREAM, API_DRIVER}}, - {"cuStreamAttachMemAsync", {"hipStreamAttachMemAsync", CONV_STREAM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuStreamCreate", {"hipStreamCreate__", CONV_STREAM, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaStreamCreate due to different signatures - {"cuStreamCreateWithPriority", {"hipStreamCreateWithPriority", CONV_STREAM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuStreamDestroy_v2", {"hipStreamDestroy", CONV_STREAM, API_DRIVER}}, - {"cuStreamGetFlags", {"hipStreamGetFlags", CONV_STREAM, API_DRIVER}}, - {"cuStreamGetPriority", {"hipStreamGetPriority", CONV_STREAM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuStreamQuery", {"hipStreamQuery", CONV_STREAM, API_DRIVER}}, - {"cuStreamSynchronize", {"hipStreamSynchronize", CONV_STREAM, API_DRIVER}}, - {"cuStreamWaitEvent", {"hipStreamWaitEvent", CONV_STREAM, API_DRIVER}}, - {"cuStreamWaitValue32", {"hipStreamWaitValue32", CONV_STREAM, API_DRIVER, HIP_UNSUPPORTED}}, // // no API_Runtime ANALOGUE - {"cuStreamWriteValue32", {"hipStreamWriteValue32", CONV_STREAM, API_DRIVER, HIP_UNSUPPORTED}}, // // no API_Runtime ANALOGUE - {"cuStreamBatchMemOp", {"hipStreamBatchMemOp", CONV_STREAM, API_DRIVER, HIP_UNSUPPORTED}}, // // no API_Runtime ANALOGUE + {"cuStreamAddCallback", {"hipStreamAddCallback", CONV_STREAM, API_DRIVER}}, + {"cuStreamAttachMemAsync", + {"hipStreamAttachMemAsync", CONV_STREAM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuStreamCreate", + {"hipStreamCreate__", CONV_STREAM, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaStreamCreate due to different signatures + {"cuStreamCreateWithPriority", + {"hipStreamCreateWithPriority", CONV_STREAM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuStreamDestroy_v2", {"hipStreamDestroy", CONV_STREAM, API_DRIVER}}, + {"cuStreamGetFlags", {"hipStreamGetFlags", CONV_STREAM, API_DRIVER}}, + {"cuStreamGetPriority", {"hipStreamGetPriority", CONV_STREAM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuStreamQuery", {"hipStreamQuery", CONV_STREAM, API_DRIVER}}, + {"cuStreamSynchronize", {"hipStreamSynchronize", CONV_STREAM, API_DRIVER}}, + {"cuStreamWaitEvent", {"hipStreamWaitEvent", CONV_STREAM, API_DRIVER}}, + {"cuStreamWaitValue32", + {"hipStreamWaitValue32", CONV_STREAM, API_DRIVER, + HIP_UNSUPPORTED}}, // // no API_Runtime ANALOGUE + {"cuStreamWriteValue32", + {"hipStreamWriteValue32", CONV_STREAM, API_DRIVER, + HIP_UNSUPPORTED}}, // // no API_Runtime ANALOGUE + {"cuStreamBatchMemOp", + {"hipStreamBatchMemOp", CONV_STREAM, API_DRIVER, + HIP_UNSUPPORTED}}, // // no API_Runtime ANALOGUE // Memory management - {"cuArray3DCreate", {"hipArray3DCreate", CONV_MEM, API_DRIVER}}, - {"cuArray3DGetDescriptor", {"hipArray3DGetDescriptor", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuArrayCreate", {"hipArrayCreate", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuArrayDestroy", {"hipArrayDestroy", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuArrayGetDescriptor", {"hipArrayGetDescriptor", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuIpcCloseMemHandle", {"hipIpcCloseMemHandle", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuIpcGetEventHandle", {"hipIpcGetEventHandle", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuIpcGetMemHandle", {"hipIpcGetMemHandle", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuIpcOpenEventHandle", {"hipIpcOpenEventHandle", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuIpcOpenMemHandle", {"hipIpcOpenMemHandle", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemAlloc_v2", {"hipMalloc", CONV_MEM, API_DRIVER}}, - {"cuMemAllocHost", {"hipMemAllocHost", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemAllocManaged", {"hipMemAllocManaged", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemAllocPitch", {"hipMemAllocPitch__", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaMemAllocPitch due to different signatures - {"cuMemcpy", {"hipMemcpy__", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy due to different signatures - {"cuMemcpy2D", {"hipMemcpy2D__", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy2D due to different signatures - {"cuMemcpy2DAsync", {"hipMemcpy2DAsync__", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy2DAsync due to different signatures - {"cuMemcpy2DUnaligned", {"hipMemcpy2DUnaligned", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemcpy3D", {"hipMemcpy3D__", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy3D due to different signatures - {"cuMemcpy3DAsync", {"hipMemcpy3DAsync__", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy3DAsync due to different signatures - {"cuMemcpy3DPeer", {"hipMemcpy3DPeer__", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy3DPeer due to different signatures - {"cuMemcpy3DPeerAsync", {"hipMemcpy3DPeerAsync__", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy3DPeerAsync due to different signatures - {"cuMemcpyAsync", {"hipMemcpyAsync__", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaMemcpyAsync due to different signatures - {"cuMemcpyAtoA", {"hipMemcpyAtoA", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemcpyAtoD", {"hipMemcpyAtoD", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemcpyAtoH", {"hipMemcpyAtoH", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemcpyAtoHAsync", {"hipMemcpyAtoHAsync", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemcpyDtoA", {"hipMemcpyDtoA", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemcpyDtoD_v2", {"hipMemcpyDtoD", CONV_MEM, API_DRIVER}}, - {"cuMemcpyDtoDAsync_v2", {"hipMemcpyDtoDAsync", CONV_MEM, API_DRIVER}}, - {"cuMemcpyDtoH_v2", {"hipMemcpyDtoH", CONV_MEM, API_DRIVER}}, - {"cuMemcpyDtoHAsync_v2", {"hipMemcpyDtoHAsync", CONV_MEM, API_DRIVER}}, - {"cuMemcpyHtoA", {"hipMemcpyHtoA", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemcpyHtoAAsync", {"hipMemcpyHtoAAsync", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemcpyHtoD_v2", {"hipMemcpyHtoD", CONV_MEM, API_DRIVER}}, - {"cuMemcpyHtoDAsync_v2", {"hipMemcpyHtoDAsync", CONV_MEM, API_DRIVER}}, - {"cuMemcpyPeerAsync", {"hipMemcpyPeerAsync__", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaMemcpyPeerAsync due to different signatures - {"cuMemcpyPeer", {"hipMemcpyPeer__", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaMemcpyPeer due to different signatures - {"cuMemFree_v2", {"hipFree", CONV_MEM, API_DRIVER}}, - {"cuMemFreeHost", {"hipHostFree", CONV_MEM, API_DRIVER}}, - {"cuMemGetAddressRange", {"hipMemGetAddressRange", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemGetInfo_v2", {"hipMemGetInfo", CONV_MEM, API_DRIVER}}, - {"cuMemHostAlloc", {"hipHostMalloc", CONV_MEM, API_DRIVER}}, // API_Runtime ANALOGUE (cudaHostAlloc) - {"cuMemHostGetDevicePointer", {"hipMemHostGetDevicePointer", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemHostGetFlags", {"hipMemHostGetFlags", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemHostRegister_v2", {"hipHostRegister", CONV_MEM, API_DRIVER}}, // API_Runtime ANALOGUE (cudaHostAlloc) - {"cuMemHostUnregister", {"hipHostUnregister", CONV_MEM, API_DRIVER}}, // API_Runtime ANALOGUE (cudaHostUnregister) - {"cuMemsetD16_v2", {"hipMemsetD16", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemsetD16Async", {"hipMemsetD16Async", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemsetD2D16_v2", {"hipMemsetD2D16", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemsetD2D16Async", {"hipMemsetD2D16Async", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemsetD2D32_v2", {"hipMemsetD2D32", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemsetD2D32Async", {"hipMemsetD2D32Async", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemsetD2D8_v2", {"hipMemsetD2D8", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemsetD2D8Async", {"hipMemsetD2D8Async", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemsetD32_v2", {"hipMemset", CONV_MEM, API_DRIVER}}, // API_Runtime ANALOGUE (cudaMemset) - {"cuMemsetD32Async", {"hipMemsetAsync", CONV_MEM, API_DRIVER}}, // API_Runtime ANALOGUE (cudaMemsetAsync) - {"cuMemsetD8_v2", {"hipMemsetD8", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMemsetD8Async", {"hipMemsetD8Async", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMipmappedArrayCreate", {"hipMipmappedArrayCreate", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMipmappedArrayDestroy", {"hipMipmappedArrayDestroy", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuMipmappedArrayGetLevel", {"hipMipmappedArrayGetLevel", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuArray3DCreate", {"hipArray3DCreate", CONV_MEM, API_DRIVER}}, + {"cuArray3DGetDescriptor", {"hipArray3DGetDescriptor", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuArrayCreate", {"hipArrayCreate", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuArrayDestroy", {"hipArrayDestroy", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuArrayGetDescriptor", {"hipArrayGetDescriptor", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuIpcCloseMemHandle", {"hipIpcCloseMemHandle", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuIpcGetEventHandle", {"hipIpcGetEventHandle", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuIpcGetMemHandle", {"hipIpcGetMemHandle", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuIpcOpenEventHandle", {"hipIpcOpenEventHandle", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuIpcOpenMemHandle", {"hipIpcOpenMemHandle", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemAlloc_v2", {"hipMalloc", CONV_MEM, API_DRIVER}}, + {"cuMemAllocHost", {"hipMemAllocHost", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemAllocManaged", {"hipMemAllocManaged", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemAllocPitch", + {"hipMemAllocPitch__", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaMemAllocPitch due to different signatures + {"cuMemcpy", + {"hipMemcpy__", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy due to different signatures + {"cuMemcpy2D", + {"hipMemcpy2D__", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy2D due to different signatures + {"cuMemcpy2DAsync", + {"hipMemcpy2DAsync__", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy2DAsync due to different signatures + {"cuMemcpy2DUnaligned", {"hipMemcpy2DUnaligned", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemcpy3D", + {"hipMemcpy3D__", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy3D due to different signatures + {"cuMemcpy3DAsync", + {"hipMemcpy3DAsync__", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy3DAsync due to different signatures + {"cuMemcpy3DPeer", + {"hipMemcpy3DPeer__", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy3DPeer due to different signatures + {"cuMemcpy3DPeerAsync", + {"hipMemcpy3DPeerAsync__", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaMemcpy3DPeerAsync due to different signatures + {"cuMemcpyAsync", + {"hipMemcpyAsync__", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaMemcpyAsync due to different signatures + {"cuMemcpyAtoA", {"hipMemcpyAtoA", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemcpyAtoD", {"hipMemcpyAtoD", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemcpyAtoH", {"hipMemcpyAtoH", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemcpyAtoHAsync", {"hipMemcpyAtoHAsync", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemcpyDtoA", {"hipMemcpyDtoA", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemcpyDtoD_v2", {"hipMemcpyDtoD", CONV_MEM, API_DRIVER}}, + {"cuMemcpyDtoDAsync_v2", {"hipMemcpyDtoDAsync", CONV_MEM, API_DRIVER}}, + {"cuMemcpyDtoH_v2", {"hipMemcpyDtoH", CONV_MEM, API_DRIVER}}, + {"cuMemcpyDtoHAsync_v2", {"hipMemcpyDtoHAsync", CONV_MEM, API_DRIVER}}, + {"cuMemcpyHtoA", {"hipMemcpyHtoA", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemcpyHtoAAsync", {"hipMemcpyHtoAAsync", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemcpyHtoD_v2", {"hipMemcpyHtoD", CONV_MEM, API_DRIVER}}, + {"cuMemcpyHtoDAsync_v2", {"hipMemcpyHtoDAsync", CONV_MEM, API_DRIVER}}, + {"cuMemcpyPeerAsync", + {"hipMemcpyPeerAsync__", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaMemcpyPeerAsync due to different signatures + {"cuMemcpyPeer", + {"hipMemcpyPeer__", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaMemcpyPeer due to different signatures + {"cuMemFree_v2", {"hipFree", CONV_MEM, API_DRIVER}}, + {"cuMemFreeHost", {"hipHostFree", CONV_MEM, API_DRIVER}}, + {"cuMemGetAddressRange", {"hipMemGetAddressRange", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemGetInfo_v2", {"hipMemGetInfo", CONV_MEM, API_DRIVER}}, + {"cuMemHostAlloc", + {"hipHostMalloc", CONV_MEM, API_DRIVER}}, // API_Runtime ANALOGUE (cudaHostAlloc) + {"cuMemHostGetDevicePointer", + {"hipMemHostGetDevicePointer", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemHostGetFlags", {"hipMemHostGetFlags", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemHostRegister_v2", + {"hipHostRegister", CONV_MEM, API_DRIVER}}, // API_Runtime ANALOGUE (cudaHostAlloc) + {"cuMemHostUnregister", + {"hipHostUnregister", CONV_MEM, API_DRIVER}}, // API_Runtime ANALOGUE (cudaHostUnregister) + {"cuMemsetD16_v2", {"hipMemsetD16", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemsetD16Async", {"hipMemsetD16Async", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemsetD2D16_v2", {"hipMemsetD2D16", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemsetD2D16Async", {"hipMemsetD2D16Async", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemsetD2D32_v2", {"hipMemsetD2D32", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemsetD2D32Async", {"hipMemsetD2D32Async", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemsetD2D8_v2", {"hipMemsetD2D8", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemsetD2D8Async", {"hipMemsetD2D8Async", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemsetD32_v2", {"hipMemset", CONV_MEM, API_DRIVER}}, // API_Runtime ANALOGUE (cudaMemset) + {"cuMemsetD32Async", + {"hipMemsetAsync", CONV_MEM, API_DRIVER}}, // API_Runtime ANALOGUE (cudaMemsetAsync) + {"cuMemsetD8_v2", {"hipMemsetD8", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemsetD8Async", {"hipMemsetD8Async", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMipmappedArrayCreate", {"hipMipmappedArrayCreate", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMipmappedArrayDestroy", + {"hipMipmappedArrayDestroy", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMipmappedArrayGetLevel", + {"hipMipmappedArrayGetLevel", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Unified Addressing - {"cuMemPrefetchAsync", {"hipMemPrefetchAsync__", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // // no API_Runtime ANALOGUE (cudaMemPrefetchAsync has different signature) - {"cuMemAdvise", {"hipMemAdvise", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // // API_Runtime ANALOGUE (cudaMemAdvise) - {"cuMemRangeGetAttribute", {"hipMemRangeGetAttribute", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // // API_Runtime ANALOGUE (cudaMemRangeGetAttribute) - {"cuMemRangeGetAttributes", {"hipMemRangeGetAttributes", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // // API_Runtime ANALOGUE (cudaMemRangeGetAttributes) - {"cuPointerGetAttribute", {"hipPointerGetAttribute", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuPointerGetAttributes", {"hipPointerGetAttributes", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuPointerSetAttribute", {"hipPointerSetAttribute", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuMemPrefetchAsync", + {"hipMemPrefetchAsync__", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // // no API_Runtime ANALOGUE (cudaMemPrefetchAsync has different + // signature) + {"cuMemAdvise", + {"hipMemAdvise", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // // API_Runtime ANALOGUE (cudaMemAdvise) + {"cuMemRangeGetAttribute", + {"hipMemRangeGetAttribute", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // // API_Runtime ANALOGUE (cudaMemRangeGetAttribute) + {"cuMemRangeGetAttributes", + {"hipMemRangeGetAttributes", CONV_MEM, API_DRIVER, + HIP_UNSUPPORTED}}, // // API_Runtime ANALOGUE (cudaMemRangeGetAttributes) + {"cuPointerGetAttribute", {"hipPointerGetAttribute", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuPointerGetAttributes", {"hipPointerGetAttributes", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuPointerSetAttribute", {"hipPointerSetAttribute", CONV_MEM, API_DRIVER, HIP_UNSUPPORTED}}, // Texture Reference Mngmnt // Texture reference filtering modes // enum CUfilter_mode/CUfilter_mode_enum - {"CU_TR_FILTER_MODE_POINT", {"hipFilterModePoint", CONV_TEX, API_DRIVER}}, // 0 // API_Runtime ANALOGUE (cudaFilterModePoint = 0) - {"CU_TR_FILTER_MODE_LINEAR", {"hipFilterModeLinear", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // 1 // API_Runtime ANALOGUE (cudaFilterModeLinear = 1) + {"CU_TR_FILTER_MODE_POINT", + {"hipFilterModePoint", CONV_TEX, + API_DRIVER}}, // 0 // API_Runtime ANALOGUE (cudaFilterModePoint = 0) + {"CU_TR_FILTER_MODE_LINEAR", + {"hipFilterModeLinear", CONV_TEX, API_DRIVER, + HIP_UNSUPPORTED}}, // 1 // API_Runtime ANALOGUE (cudaFilterModeLinear = 1) - {"cuTexRefGetAddress", {"hipTexRefGetAddress", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefGetAddressMode", {"hipTexRefGetAddressMode", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefGetArray", {"hipTexRefGetArray", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefGetBorderColor", {"hipTexRefGetBorderColor", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // // no API_Runtime ANALOGUE - {"cuTexRefGetFilterMode", {"hipTexRefGetFilterMode", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefGetFlags", {"hipTexRefGetFlags", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefGetFormat", {"hipTexRefGetFormat", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefGetMaxAnisotropy", {"hipTexRefGetMaxAnisotropy", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefGetMipmapFilterMode", {"hipTexRefGetMipmapFilterMode", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefGetMipmapLevelBias", {"hipTexRefGetMipmapLevelBias", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefGetMipmapLevelClamp", {"hipTexRefGetMipmapLevelClamp", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefGetMipmappedArray", {"hipTexRefGetMipmappedArray", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefSetAddress", {"hipTexRefSetAddress", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefSetAddress2D", {"hipTexRefSetAddress2D", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefSetAddressMode", {"hipTexRefSetAddressMode", CONV_TEX, API_DRIVER}}, - {"cuTexRefSetArray", {"hipTexRefSetArray", CONV_TEX, API_DRIVER}}, - {"cuTexRefSetBorderColor", {"hipTexRefSetBorderColor", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // // no API_Runtime ANALOGUE - {"cuTexRefSetFilterMode", {"hipTexRefSetFilterMode", CONV_TEX, API_DRIVER}}, - {"cuTexRefSetFlags", {"hipTexRefSetFlags", CONV_TEX, API_DRIVER}}, - {"cuTexRefSetFormat", {"hipTexRefSetFormat", CONV_TEX, API_DRIVER}}, - {"cuTexRefSetMaxAnisotropy", {"hipTexRefSetMaxAnisotropy", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefSetMipmapFilterMode", {"hipTexRefSetMipmapFilterMode", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefSetMipmapLevelBias", {"hipTexRefSetMipmapLevelBias", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefSetMipmapLevelClamp", {"hipTexRefSetMipmapLevelClamp", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefSetMipmappedArray", {"hipTexRefSetMipmappedArray", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefGetAddress", {"hipTexRefGetAddress", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefGetAddressMode", {"hipTexRefGetAddressMode", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefGetArray", {"hipTexRefGetArray", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefGetBorderColor", + {"hipTexRefGetBorderColor", CONV_TEX, API_DRIVER, + HIP_UNSUPPORTED}}, // // no API_Runtime ANALOGUE + {"cuTexRefGetFilterMode", {"hipTexRefGetFilterMode", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefGetFlags", {"hipTexRefGetFlags", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefGetFormat", {"hipTexRefGetFormat", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefGetMaxAnisotropy", + {"hipTexRefGetMaxAnisotropy", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefGetMipmapFilterMode", + {"hipTexRefGetMipmapFilterMode", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefGetMipmapLevelBias", + {"hipTexRefGetMipmapLevelBias", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefGetMipmapLevelClamp", + {"hipTexRefGetMipmapLevelClamp", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefGetMipmappedArray", + {"hipTexRefGetMipmappedArray", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefSetAddress", {"hipTexRefSetAddress", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefSetAddress2D", {"hipTexRefSetAddress2D", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefSetAddressMode", {"hipTexRefSetAddressMode", CONV_TEX, API_DRIVER}}, + {"cuTexRefSetArray", {"hipTexRefSetArray", CONV_TEX, API_DRIVER}}, + {"cuTexRefSetBorderColor", + {"hipTexRefSetBorderColor", CONV_TEX, API_DRIVER, + HIP_UNSUPPORTED}}, // // no API_Runtime ANALOGUE + {"cuTexRefSetFilterMode", {"hipTexRefSetFilterMode", CONV_TEX, API_DRIVER}}, + {"cuTexRefSetFlags", {"hipTexRefSetFlags", CONV_TEX, API_DRIVER}}, + {"cuTexRefSetFormat", {"hipTexRefSetFormat", CONV_TEX, API_DRIVER}}, + {"cuTexRefSetMaxAnisotropy", + {"hipTexRefSetMaxAnisotropy", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefSetMipmapFilterMode", + {"hipTexRefSetMipmapFilterMode", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefSetMipmapLevelBias", + {"hipTexRefSetMipmapLevelBias", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefSetMipmapLevelClamp", + {"hipTexRefSetMipmapLevelClamp", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefSetMipmappedArray", + {"hipTexRefSetMipmappedArray", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // Texture Reference Mngmnt [DEPRECATED] - {"cuTexRefCreate", {"hipTexRefCreate", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexRefDestroy", {"hipTexRefDestroy", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefCreate", {"hipTexRefCreate", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexRefDestroy", {"hipTexRefDestroy", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // Surface Reference Mngmnt - {"cuSurfRefGetArray", {"hipSurfRefGetArray", CONV_SURFACE, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuSurfRefSetArray", {"hipSurfRefSetArray", CONV_SURFACE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuSurfRefGetArray", {"hipSurfRefGetArray", CONV_SURFACE, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuSurfRefSetArray", {"hipSurfRefSetArray", CONV_SURFACE, API_DRIVER, HIP_UNSUPPORTED}}, // Texture Object Mngmnt - {"cuTexObjectCreate", {"hipTexObjectCreate", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexObjectDestroy", {"hipTexObjectDestroy", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexObjectGetResourceDesc", {"hipTexObjectGetResourceDesc", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexObjectGetResourceViewDesc", {"hipTexObjectGetResourceViewDesc", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuTexObjectGetTextureDesc", {"hipTexObjectGetTextureDesc", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexObjectCreate", {"hipTexObjectCreate", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexObjectDestroy", {"hipTexObjectDestroy", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexObjectGetResourceDesc", + {"hipTexObjectGetResourceDesc", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexObjectGetResourceViewDesc", + {"hipTexObjectGetResourceViewDesc", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuTexObjectGetTextureDesc", + {"hipTexObjectGetTextureDesc", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // Surface Object Mngmnt - {"cuSurfObjectCreate", {"hipSurfObjectCreate", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuSurfObjectDestroy", {"hipSurfObjectDestroy", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, - {"cuSurfObjectGetResourceDesc", {"hipSurfObjectGetResourceDesc", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuSurfObjectCreate", {"hipSurfObjectCreate", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuSurfObjectDestroy", {"hipSurfObjectDestroy", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, + {"cuSurfObjectGetResourceDesc", + {"hipSurfObjectGetResourceDesc", CONV_TEX, API_DRIVER, HIP_UNSUPPORTED}}, // Graphics Interoperability - {"cuGraphicsMapResources", {"hipGraphicsMapResources", CONV_GRAPHICS, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsMapResources) - {"cuGraphicsResourceGetMappedMipmappedArray", {"hipGraphicsResourceGetMappedMipmappedArray", CONV_GRAPHICS, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsResourceGetMappedMipmappedArray) - {"cuGraphicsResourceGetMappedPointer", {"hipGraphicsResourceGetMappedPointer", CONV_GRAPHICS, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsResourceGetMappedPointer) - {"cuGraphicsResourceSetMapFlags", {"hipGraphicsResourceSetMapFlags", CONV_GRAPHICS, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsResourceSetMapFlags) - {"cuGraphicsSubResourceGetMappedArray", {"hipGraphicsSubResourceGetMappedArray", CONV_GRAPHICS, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsSubResourceGetMappedArray) - {"cuGraphicsUnmapResources", {"hipGraphicsUnmapResources", CONV_GRAPHICS, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsUnmapResources) - {"cuGraphicsUnregisterResource", {"hipGraphicsUnregisterResource", CONV_GRAPHICS, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsUnregisterResource) + {"cuGraphicsMapResources", + {"hipGraphicsMapResources", CONV_GRAPHICS, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsMapResources) + {"cuGraphicsResourceGetMappedMipmappedArray", + {"hipGraphicsResourceGetMappedMipmappedArray", CONV_GRAPHICS, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsResourceGetMappedMipmappedArray) + {"cuGraphicsResourceGetMappedPointer", + {"hipGraphicsResourceGetMappedPointer", CONV_GRAPHICS, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsResourceGetMappedPointer) + {"cuGraphicsResourceSetMapFlags", + {"hipGraphicsResourceSetMapFlags", CONV_GRAPHICS, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsResourceSetMapFlags) + {"cuGraphicsSubResourceGetMappedArray", + {"hipGraphicsSubResourceGetMappedArray", CONV_GRAPHICS, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsSubResourceGetMappedArray) + {"cuGraphicsUnmapResources", + {"hipGraphicsUnmapResources", CONV_GRAPHICS, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsUnmapResources) + {"cuGraphicsUnregisterResource", + {"hipGraphicsUnregisterResource", CONV_GRAPHICS, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsUnregisterResource) // Profiler - {"cuProfilerInitialize", {"hipProfilerInitialize", CONV_OTHER, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaProfilerInitialize) - {"cuProfilerStart", {"hipProfilerStart", CONV_OTHER, API_DRIVER}}, // API_Runtime ANALOGUE (cudaProfilerStart) - {"cuProfilerStop", {"hipProfilerStop", CONV_OTHER, API_DRIVER}}, // API_Runtime ANALOGUE (cudaProfilerStop) + {"cuProfilerInitialize", + {"hipProfilerInitialize", CONV_OTHER, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaProfilerInitialize) + {"cuProfilerStart", + {"hipProfilerStart", CONV_OTHER, API_DRIVER}}, // API_Runtime ANALOGUE (cudaProfilerStart) + {"cuProfilerStop", + {"hipProfilerStop", CONV_OTHER, API_DRIVER}}, // API_Runtime ANALOGUE (cudaProfilerStop) // OpenGL Interoperability // enum CUGLDeviceList/CUGLDeviceList_enum - {"CU_GL_DEVICE_LIST_ALL", {"HIP_GL_DEVICE_LIST_ALL", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaGLDeviceListAll) - {"CU_GL_DEVICE_LIST_CURRENT_FRAME", {"HIP_GL_DEVICE_LIST_CURRENT_FRAME", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaGLDeviceListCurrentFrame) - {"CU_GL_DEVICE_LIST_NEXT_FRAME", {"HIP_GL_DEVICE_LIST_NEXT_FRAME", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaGLDeviceListNextFrame) + {"CU_GL_DEVICE_LIST_ALL", + {"HIP_GL_DEVICE_LIST_ALL", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaGLDeviceListAll) + {"CU_GL_DEVICE_LIST_CURRENT_FRAME", + {"HIP_GL_DEVICE_LIST_CURRENT_FRAME", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaGLDeviceListCurrentFrame) + {"CU_GL_DEVICE_LIST_NEXT_FRAME", + {"HIP_GL_DEVICE_LIST_NEXT_FRAME", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaGLDeviceListNextFrame) - {"cuGLGetDevices", {"hipGLGetDevices", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLGetDevices) - {"cuGraphicsGLRegisterBuffer", {"hipGraphicsGLRegisterBuffer", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsGLRegisterBuffer) - {"cuGraphicsGLRegisterImage", {"hipGraphicsGLRegisterImage", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsGLRegisterImage) - {"cuWGLGetDevice", {"hipWGLGetDevice", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaWGLGetDevice) + {"cuGLGetDevices", + {"hipGLGetDevices", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLGetDevices) + {"cuGraphicsGLRegisterBuffer", + {"hipGraphicsGLRegisterBuffer", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsGLRegisterBuffer) + {"cuGraphicsGLRegisterImage", + {"hipGraphicsGLRegisterImage", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsGLRegisterImage) + {"cuWGLGetDevice", + {"hipWGLGetDevice", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaWGLGetDevice) // OpenGL Interoperability [DEPRECATED] // enum CUGLmap_flags/CUGLmap_flags_enum - {"CU_GL_MAP_RESOURCE_FLAGS_NONE", {"HIP_GL_MAP_RESOURCE_FLAGS_NONE", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaGLMapFlagsNone) - {"CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY", {"HIP_GL_MAP_RESOURCE_FLAGS_READ_ONLY", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaGLMapFlagsReadOnly) - {"CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD", {"HIP_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaGLMapFlagsWriteDiscard) + {"CU_GL_MAP_RESOURCE_FLAGS_NONE", + {"HIP_GL_MAP_RESOURCE_FLAGS_NONE", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaGLMapFlagsNone) + {"CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY", + {"HIP_GL_MAP_RESOURCE_FLAGS_READ_ONLY", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaGLMapFlagsReadOnly) + {"CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD", + {"HIP_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaGLMapFlagsWriteDiscard) - {"cuGLCtxCreate", {"hipGLCtxCreate", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE - {"cuGLInit", {"hipGLInit", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE - {"cuGLMapBufferObject", {"hipGLMapBufferObject", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaGLMapBufferObject due to different signatures - {"cuGLMapBufferObjectAsync", {"hipGLMapBufferObjectAsync", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // Not equal to cudaGLMapBufferObjectAsync due to different signatures - {"cuGLRegisterBufferObject", {"hipGLRegisterBufferObject", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLRegisterBufferObject) - {"cuGLSetBufferObjectMapFlags", {"hipGLSetBufferObjectMapFlags", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLSetBufferObjectMapFlags) - {"cuGLUnmapBufferObject", {"hipGLUnmapBufferObject", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLUnmapBufferObject) - {"cuGLUnmapBufferObjectAsync", {"hipGLUnmapBufferObjectAsync", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLUnmapBufferObjectAsync) - {"cuGLUnregisterBufferObject", {"hipGLUnregisterBufferObject", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLUnregisterBufferObject) + {"cuGLCtxCreate", + {"hipGLCtxCreate", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE + {"cuGLInit", {"hipGLInit", CONV_GL, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE + {"cuGLMapBufferObject", + {"hipGLMapBufferObject", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaGLMapBufferObject due to different signatures + {"cuGLMapBufferObjectAsync", + {"hipGLMapBufferObjectAsync", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // Not equal to cudaGLMapBufferObjectAsync due to different signatures + {"cuGLRegisterBufferObject", + {"hipGLRegisterBufferObject", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLRegisterBufferObject) + {"cuGLSetBufferObjectMapFlags", + {"hipGLSetBufferObjectMapFlags", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLSetBufferObjectMapFlags) + {"cuGLUnmapBufferObject", + {"hipGLUnmapBufferObject", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLUnmapBufferObject) + {"cuGLUnmapBufferObjectAsync", + {"hipGLUnmapBufferObjectAsync", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLUnmapBufferObjectAsync) + {"cuGLUnregisterBufferObject", + {"hipGLUnregisterBufferObject", CONV_GL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGLUnregisterBufferObject) // Direct3D 9 Interoperability // enum CUd3d9DeviceList/CUd3d9DeviceList_enum - {"CU_D3D9_DEVICE_LIST_ALL", {"HIP_D3D9_DEVICE_LIST_ALL", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D9DeviceListAll) - {"CU_D3D9_DEVICE_LIST_CURRENT_FRAME", {"HIP_D3D9_DEVICE_LIST_CURRENT_FRAME", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaD3D9DeviceListCurrentFrame) - {"CU_D3D9_DEVICE_LIST_NEXT_FRAME", {"HIP_D3D9_DEVICE_LIST_NEXT_FRAME", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaD3D9DeviceListNextFrame) + {"CU_D3D9_DEVICE_LIST_ALL", + {"HIP_D3D9_DEVICE_LIST_ALL", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D9DeviceListAll) + {"CU_D3D9_DEVICE_LIST_CURRENT_FRAME", + {"HIP_D3D9_DEVICE_LIST_CURRENT_FRAME", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaD3D9DeviceListCurrentFrame) + {"CU_D3D9_DEVICE_LIST_NEXT_FRAME", + {"HIP_D3D9_DEVICE_LIST_NEXT_FRAME", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaD3D9DeviceListNextFrame) - {"cuD3D9CtxCreate", {"hipD3D9CtxCreate", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE - {"cuD3D9CtxCreateOnDevice", {"hipD3D9CtxCreateOnDevice", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE - {"cuD3D9GetDevice", {"hipD3D9GetDevice", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9GetDevice) - {"cuD3D9GetDevices", {"hipD3D9GetDevices", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9GetDevices) - {"cuD3D9GetDirect3DDevice", {"hipD3D9GetDirect3DDevice", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9GetDirect3DDevice) - {"cuGraphicsD3D9RegisterResource", {"hipGraphicsD3D9RegisterResource", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsD3D9RegisterResource) + {"cuD3D9CtxCreate", + {"hipD3D9CtxCreate", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE + {"cuD3D9CtxCreateOnDevice", + {"hipD3D9CtxCreateOnDevice", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE + {"cuD3D9GetDevice", + {"hipD3D9GetDevice", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9GetDevice) + {"cuD3D9GetDevices", + {"hipD3D9GetDevices", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9GetDevices) + {"cuD3D9GetDirect3DDevice", + {"hipD3D9GetDirect3DDevice", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9GetDirect3DDevice) + {"cuGraphicsD3D9RegisterResource", + {"hipGraphicsD3D9RegisterResource", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsD3D9RegisterResource) // Direct3D 9 Interoperability [DEPRECATED] // enum CUd3d9map_flags/CUd3d9map_flags_enum - {"CU_D3D9_MAPRESOURCE_FLAGS_NONE", {"HIP_D3D9_MAPRESOURCE_FLAGS_NONE", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaD3D9MapFlagsNone) - {"CU_D3D9_MAPRESOURCE_FLAGS_READONLY", {"HIP_D3D9_MAPRESOURCE_FLAGS_READONLY", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D9MapFlagsReadOnly) - {"CU_D3D9_MAPRESOURCE_FLAGS_WRITEDISCARD", {"HIP_D3D9_MAPRESOURCE_FLAGS_WRITEDISCARD", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaD3D9MapFlagsWriteDiscard) + {"CU_D3D9_MAPRESOURCE_FLAGS_NONE", + {"HIP_D3D9_MAPRESOURCE_FLAGS_NONE", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaD3D9MapFlagsNone) + {"CU_D3D9_MAPRESOURCE_FLAGS_READONLY", + {"HIP_D3D9_MAPRESOURCE_FLAGS_READONLY", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D9MapFlagsReadOnly) + {"CU_D3D9_MAPRESOURCE_FLAGS_WRITEDISCARD", + {"HIP_D3D9_MAPRESOURCE_FLAGS_WRITEDISCARD", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaD3D9MapFlagsWriteDiscard) // enum CUd3d9register_flags/CUd3d9register_flags_enum - {"CU_D3D9_REGISTER_FLAGS_NONE", {"HIP_D3D9_REGISTER_FLAGS_NONE", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaD3D9RegisterFlagsNone) - {"CU_D3D9_REGISTER_FLAGS_ARRAY", {"HIP_D3D9_REGISTER_FLAGS_ARRAY", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D9RegisterFlagsArray) + {"CU_D3D9_REGISTER_FLAGS_NONE", + {"HIP_D3D9_REGISTER_FLAGS_NONE", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaD3D9RegisterFlagsNone) + {"CU_D3D9_REGISTER_FLAGS_ARRAY", + {"HIP_D3D9_REGISTER_FLAGS_ARRAY", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D9RegisterFlagsArray) - {"cuD3D9MapResources", {"hipD3D9MapResources", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9MapResources) - {"cuD3D9RegisterResource", {"hipD3D9RegisterResource", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9RegisterResource) - {"cuD3D9ResourceGetMappedArray", {"hipD3D9ResourceGetMappedArray", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9ResourceGetMappedArray) - {"cuD3D9ResourceGetMappedPitch", {"hipD3D9ResourceGetMappedPitch", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9ResourceGetMappedPitch) - {"cuD3D9ResourceGetMappedPointer", {"hipD3D9ResourceGetMappedPointer", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9ResourceGetMappedPointer) - {"cuD3D9ResourceGetMappedSize", {"hipD3D9ResourceGetMappedSize", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9ResourceGetMappedSize) - {"cuD3D9ResourceGetSurfaceDimensions", {"hipD3D9ResourceGetSurfaceDimensions", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9ResourceGetSurfaceDimensions) - {"cuD3D9ResourceSetMapFlags", {"hipD3D9ResourceSetMapFlags", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9ResourceSetMapFlags) - {"cuD3D9UnmapResources", {"hipD3D9UnmapResources", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9UnmapResources) - {"cuD3D9UnregisterResource", {"hipD3D9UnregisterResource", CONV_D3D9, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9UnregisterResource) + {"cuD3D9MapResources", + {"hipD3D9MapResources", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9MapResources) + {"cuD3D9RegisterResource", + {"hipD3D9RegisterResource", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9RegisterResource) + {"cuD3D9ResourceGetMappedArray", + {"hipD3D9ResourceGetMappedArray", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9ResourceGetMappedArray) + {"cuD3D9ResourceGetMappedPitch", + {"hipD3D9ResourceGetMappedPitch", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9ResourceGetMappedPitch) + {"cuD3D9ResourceGetMappedPointer", + {"hipD3D9ResourceGetMappedPointer", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9ResourceGetMappedPointer) + {"cuD3D9ResourceGetMappedSize", + {"hipD3D9ResourceGetMappedSize", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9ResourceGetMappedSize) + {"cuD3D9ResourceGetSurfaceDimensions", + {"hipD3D9ResourceGetSurfaceDimensions", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9ResourceGetSurfaceDimensions) + {"cuD3D9ResourceSetMapFlags", + {"hipD3D9ResourceSetMapFlags", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9ResourceSetMapFlags) + {"cuD3D9UnmapResources", + {"hipD3D9UnmapResources", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9UnmapResources) + {"cuD3D9UnregisterResource", + {"hipD3D9UnregisterResource", CONV_D3D9, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D9UnregisterResource) // Direct3D 10 Interoperability // enum CUd3d10DeviceList/CUd3d10DeviceList_enum - {"CU_D3D10_DEVICE_LIST_ALL", {"HIP_D3D10_DEVICE_LIST_ALL", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D10DeviceListAll) - {"CU_D3D10_DEVICE_LIST_CURRENT_FRAME", {"HIP_D3D10_DEVICE_LIST_CURRENT_FRAME", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaD3D10DeviceListCurrentFrame) - {"CU_D3D10_DEVICE_LIST_NEXT_FRAME", {"HIP_D3D10_DEVICE_LIST_NEXT_FRAME", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaD3D10DeviceListNextFrame) + {"CU_D3D10_DEVICE_LIST_ALL", + {"HIP_D3D10_DEVICE_LIST_ALL", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D10DeviceListAll) + {"CU_D3D10_DEVICE_LIST_CURRENT_FRAME", + {"HIP_D3D10_DEVICE_LIST_CURRENT_FRAME", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaD3D10DeviceListCurrentFrame) + {"CU_D3D10_DEVICE_LIST_NEXT_FRAME", + {"HIP_D3D10_DEVICE_LIST_NEXT_FRAME", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaD3D10DeviceListNextFrame) - {"cuD3D10GetDevice", {"hipD3D10GetDevice", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10GetDevice) - {"cuD3D10GetDevices", {"hipD3D10GetDevices", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10GetDevices) - {"cuGraphicsD3D10RegisterResource", {"hipGraphicsD3D10RegisterResource", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsD3D10RegisterResource) + {"cuD3D10GetDevice", + {"hipD3D10GetDevice", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10GetDevice) + {"cuD3D10GetDevices", + {"hipD3D10GetDevices", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10GetDevices) + {"cuGraphicsD3D10RegisterResource", + {"hipGraphicsD3D10RegisterResource", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsD3D10RegisterResource) // Direct3D 10 Interoperability [DEPRECATED] // enum CUd3d10map_flags/CUd3d10map_flags_enum - {"CU_D3D10_MAPRESOURCE_FLAGS_NONE", {"HIP_D3D10_MAPRESOURCE_FLAGS_NONE", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaD3D10MapFlagsNone) - {"CU_D3D10_MAPRESOURCE_FLAGS_READONLY", {"HIP_D3D10_MAPRESOURCE_FLAGS_READONLY", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D10MapFlagsReadOnly) - {"CU_D3D10_MAPRESOURCE_FLAGS_WRITEDISCARD", {"HIP_D3D10_MAPRESOURCE_FLAGS_WRITEDISCARD", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaD3D10MapFlagsWriteDiscard) + {"CU_D3D10_MAPRESOURCE_FLAGS_NONE", + {"HIP_D3D10_MAPRESOURCE_FLAGS_NONE", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaD3D10MapFlagsNone) + {"CU_D3D10_MAPRESOURCE_FLAGS_READONLY", + {"HIP_D3D10_MAPRESOURCE_FLAGS_READONLY", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D10MapFlagsReadOnly) + {"CU_D3D10_MAPRESOURCE_FLAGS_WRITEDISCARD", + {"HIP_D3D10_MAPRESOURCE_FLAGS_WRITEDISCARD", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaD3D10MapFlagsWriteDiscard) // enum CUd3d10register_flags/CUd3d10register_flags_enum - {"CU_D3D10_REGISTER_FLAGS_NONE", {"HIP_D3D10_REGISTER_FLAGS_NONE", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaD3D10RegisterFlagsNone) - {"CU_D3D10_REGISTER_FLAGS_ARRAY", {"HIP_D3D10_REGISTER_FLAGS_ARRAY", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D10RegisterFlagsArray) + {"CU_D3D10_REGISTER_FLAGS_NONE", + {"HIP_D3D10_REGISTER_FLAGS_NONE", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x00 // API_Runtime ANALOGUE (cudaD3D10RegisterFlagsNone) + {"CU_D3D10_REGISTER_FLAGS_ARRAY", + {"HIP_D3D10_REGISTER_FLAGS_ARRAY", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D10RegisterFlagsArray) - {"cuD3D10CtxCreate", {"hipD3D10CtxCreate", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE - {"cuD3D10CtxCreateOnDevice", {"hipD3D10CtxCreateOnDevice", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE - {"cuD3D10GetDirect3DDevice", {"hipD3D10GetDirect3DDevice", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10GetDirect3DDevice) - {"cuD3D10MapResources", {"hipD3D10MapResources", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10MapResources) - {"cuD3D10RegisterResource", {"hipD3D10RegisterResource", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10RegisterResource) - {"cuD3D10ResourceGetMappedArray", {"hipD3D10ResourceGetMappedArray", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10ResourceGetMappedArray) - {"cuD3D10ResourceGetMappedPitch", {"hipD3D10ResourceGetMappedPitch", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10ResourceGetMappedPitch) - {"cuD3D10ResourceGetMappedPointer", {"hipD3D10ResourceGetMappedPointer", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10ResourceGetMappedPointer) - {"cuD3D10ResourceGetMappedSize", {"hipD3D10ResourceGetMappedSize", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10ResourceGetMappedSize) - {"cuD3D10ResourceGetSurfaceDimensions", {"hipD3D10ResourceGetSurfaceDimensions", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10ResourceGetSurfaceDimensions) - {"cuD310ResourceSetMapFlags", {"hipD3D10ResourceSetMapFlags", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10ResourceSetMapFlags) - {"cuD3D10UnmapResources", {"hipD3D10UnmapResources", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10UnmapResources) - {"cuD3D10UnregisterResource", {"hipD3D10UnregisterResource", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10UnregisterResource) + {"cuD3D10CtxCreate", + {"hipD3D10CtxCreate", CONV_D3D10, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE + {"cuD3D10CtxCreateOnDevice", + {"hipD3D10CtxCreateOnDevice", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE + {"cuD3D10GetDirect3DDevice", + {"hipD3D10GetDirect3DDevice", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10GetDirect3DDevice) + {"cuD3D10MapResources", + {"hipD3D10MapResources", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10MapResources) + {"cuD3D10RegisterResource", + {"hipD3D10RegisterResource", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10RegisterResource) + {"cuD3D10ResourceGetMappedArray", + {"hipD3D10ResourceGetMappedArray", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10ResourceGetMappedArray) + {"cuD3D10ResourceGetMappedPitch", + {"hipD3D10ResourceGetMappedPitch", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10ResourceGetMappedPitch) + {"cuD3D10ResourceGetMappedPointer", + {"hipD3D10ResourceGetMappedPointer", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10ResourceGetMappedPointer) + {"cuD3D10ResourceGetMappedSize", + {"hipD3D10ResourceGetMappedSize", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10ResourceGetMappedSize) + {"cuD3D10ResourceGetSurfaceDimensions", + {"hipD3D10ResourceGetSurfaceDimensions", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10ResourceGetSurfaceDimensions) + {"cuD310ResourceSetMapFlags", + {"hipD3D10ResourceSetMapFlags", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10ResourceSetMapFlags) + {"cuD3D10UnmapResources", + {"hipD3D10UnmapResources", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10UnmapResources) + {"cuD3D10UnregisterResource", + {"hipD3D10UnregisterResource", CONV_D3D10, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D10UnregisterResource) // Direct3D 11 Interoperability // enum CUd3d11DeviceList/CUd3d11DeviceList_enum - {"CU_D3D11_DEVICE_LIST_ALL", {"HIP_D3D11_DEVICE_LIST_ALL", CONV_D3D11, API_DRIVER, HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D11DeviceListAll) - {"CU_D3D11_DEVICE_LIST_CURRENT_FRAME", {"HIP_D3D11_DEVICE_LIST_CURRENT_FRAME", CONV_D3D11, API_DRIVER, HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaD3D11DeviceListCurrentFrame) - {"CU_D3D11_DEVICE_LIST_NEXT_FRAME", {"HIP_D3D11_DEVICE_LIST_NEXT_FRAME", CONV_D3D11, API_DRIVER, HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaD3D11DeviceListNextFrame) + {"CU_D3D11_DEVICE_LIST_ALL", + {"HIP_D3D11_DEVICE_LIST_ALL", CONV_D3D11, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x01 // API_Runtime ANALOGUE (cudaD3D11DeviceListAll) + {"CU_D3D11_DEVICE_LIST_CURRENT_FRAME", + {"HIP_D3D11_DEVICE_LIST_CURRENT_FRAME", CONV_D3D11, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x02 // API_Runtime ANALOGUE (cudaD3D11DeviceListCurrentFrame) + {"CU_D3D11_DEVICE_LIST_NEXT_FRAME", + {"HIP_D3D11_DEVICE_LIST_NEXT_FRAME", CONV_D3D11, API_DRIVER, + HIP_UNSUPPORTED}}, // 0x03 // API_Runtime ANALOGUE (cudaD3D11DeviceListNextFrame) - {"cuD3D11GetDevice", {"hipD3D11GetDevice", CONV_D3D11, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D11GetDevice) - {"cuD3D11GetDevices", {"hipD3D11GetDevices", CONV_D3D11, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D11GetDevices) - {"cuGraphicsD3D11RegisterResource", {"hipGraphicsD3D11RegisterResource", CONV_D3D11, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsD3D11RegisterResource) + {"cuD3D11GetDevice", + {"hipD3D11GetDevice", CONV_D3D11, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D11GetDevice) + {"cuD3D11GetDevices", + {"hipD3D11GetDevices", CONV_D3D11, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D11GetDevices) + {"cuGraphicsD3D11RegisterResource", + {"hipGraphicsD3D11RegisterResource", CONV_D3D11, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsD3D11RegisterResource) // Direct3D 11 Interoperability [DEPRECATED] - {"cuD3D11CtxCreate", {"hipD3D11CtxCreate", CONV_D3D11, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE - {"cuD3D11CtxCreateOnDevice", {"hipD3D11CtxCreateOnDevice", CONV_D3D11, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE - {"cuD3D11GetDirect3DDevice", {"hipD3D11GetDirect3DDevice", CONV_D3D11, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D11GetDirect3DDevice) + {"cuD3D11CtxCreate", + {"hipD3D11CtxCreate", CONV_D3D11, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE + {"cuD3D11CtxCreateOnDevice", + {"hipD3D11CtxCreateOnDevice", CONV_D3D11, API_DRIVER, + HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE + {"cuD3D11GetDirect3DDevice", + {"hipD3D11GetDirect3DDevice", CONV_D3D11, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaD3D11GetDirect3DDevice) // VDPAU Interoperability - {"cuGraphicsVDPAURegisterOutputSurface", {"hipGraphicsVDPAURegisterOutputSurface", CONV_VDPAU, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsVDPAURegisterOutputSurface) - {"cuGraphicsVDPAURegisterVideoSurface", {"hipGraphicsVDPAURegisterVideoSurface", CONV_VDPAU, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsVDPAURegisterVideoSurface) - {"cuVDPAUGetDevice", {"hipVDPAUGetDevice", CONV_VDPAU, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaVDPAUGetDevice) - {"cuVDPAUCtxCreate", {"hipVDPAUCtxCreate", CONV_VDPAU, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE + {"cuGraphicsVDPAURegisterOutputSurface", + {"hipGraphicsVDPAURegisterOutputSurface", CONV_VDPAU, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsVDPAURegisterOutputSurface) + {"cuGraphicsVDPAURegisterVideoSurface", + {"hipGraphicsVDPAURegisterVideoSurface", CONV_VDPAU, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsVDPAURegisterVideoSurface) + {"cuVDPAUGetDevice", + {"hipVDPAUGetDevice", CONV_VDPAU, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaVDPAUGetDevice) + {"cuVDPAUCtxCreate", + {"hipVDPAUCtxCreate", CONV_VDPAU, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE // EGL Interoperability - {"cuEGLStreamConsumerAcquireFrame", {"hipEGLStreamConsumerAcquireFrame", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamConsumerAcquireFrame) - {"cuEGLStreamConsumerConnect", {"hipEGLStreamConsumerConnect", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamConsumerConnect) - {"cuEGLStreamConsumerConnectWithFlags", {"hipEGLStreamConsumerConnectWithFlags", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamConsumerConnectWithFlags) - {"cuEGLStreamConsumerDisconnect", {"hipEGLStreamConsumerDisconnect", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE - {"cuEGLStreamConsumerReleaseFrame", {"hipEGLStreamConsumerReleaseFrame", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamConsumerReleaseFrame) - {"cuEGLStreamProducerConnect", {"hipEGLStreamProducerConnect", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamProducerConnect) - {"cuEGLStreamProducerDisconnect", {"hipEGLStreamProducerDisconnect", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamProducerDisconnect) - {"cuEGLStreamProducerPresentFrame", {"hipEGLStreamProducerPresentFrame", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamProducerPresentFrame) - {"cuEGLStreamProducerReturnFrame", {"hipEGLStreamProducerReturnFrame", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamProducerReturnFrame) - {"cuGraphicsEGLRegisterImage", {"hipGraphicsEGLRegisterImage", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsEGLRegisterImage) - {"cuGraphicsResourceGetMappedEglFrame", {"hipGraphicsResourceGetMappedEglFrame", CONV_EGL, API_DRIVER, HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsResourceGetMappedEglFrame) + {"cuEGLStreamConsumerAcquireFrame", + {"hipEGLStreamConsumerAcquireFrame", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamConsumerAcquireFrame) + {"cuEGLStreamConsumerConnect", + {"hipEGLStreamConsumerConnect", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamConsumerConnect) + {"cuEGLStreamConsumerConnectWithFlags", + {"hipEGLStreamConsumerConnectWithFlags", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamConsumerConnectWithFlags) + {"cuEGLStreamConsumerDisconnect", + {"hipEGLStreamConsumerDisconnect", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // no API_Runtime ANALOGUE + {"cuEGLStreamConsumerReleaseFrame", + {"hipEGLStreamConsumerReleaseFrame", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamConsumerReleaseFrame) + {"cuEGLStreamProducerConnect", + {"hipEGLStreamProducerConnect", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamProducerConnect) + {"cuEGLStreamProducerDisconnect", + {"hipEGLStreamProducerDisconnect", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamProducerDisconnect) + {"cuEGLStreamProducerPresentFrame", + {"hipEGLStreamProducerPresentFrame", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamProducerPresentFrame) + {"cuEGLStreamProducerReturnFrame", + {"hipEGLStreamProducerReturnFrame", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaEGLStreamProducerReturnFrame) + {"cuGraphicsEGLRegisterImage", + {"hipGraphicsEGLRegisterImage", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsEGLRegisterImage) + {"cuGraphicsResourceGetMappedEglFrame", + {"hipGraphicsResourceGetMappedEglFrame", CONV_EGL, API_DRIVER, + HIP_UNSUPPORTED}}, // API_Runtime ANALOGUE (cudaGraphicsResourceGetMappedEglFrame) -/////////////////////////////// CUDA RT API /////////////////////////////// + /////////////////////////////// CUDA RT API /////////////////////////////// // Data types {"cudaDataType_t", {"hipDataType_t", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaDataType", {"hipDataType_t", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_R_16F", {"hipR16F", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_C_16F", {"hipC16F", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_R_32F", {"hipR32F", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_C_32F", {"hipC32F", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_R_64F", {"hipR64F", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_C_64F", {"hipC64F", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_R_8I", {"hipR8I", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_C_8I", {"hipC8I", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_R_8U", {"hipR8U", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_C_8U", {"hipC8U", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_R_32I", {"hipR32I", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_C_32I", {"hipC32I", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_R_32U", {"hipR32U", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"CUDA_C_32U", {"hipC32U", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaDataType", {"hipDataType_t", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_R_16F", {"hipR16F", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_C_16F", {"hipC16F", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_R_32F", {"hipR32F", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_C_32F", {"hipC32F", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_R_64F", {"hipR64F", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_C_64F", {"hipC64F", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_R_8I", {"hipR8I", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_C_8I", {"hipC8I", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_R_8U", {"hipR8U", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_C_8U", {"hipC8U", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_R_32I", {"hipR32I", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_C_32I", {"hipC32I", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_R_32U", {"hipR32U", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"CUDA_C_32U", {"hipC32U", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // Library property types // IMPORTANT: no cuda prefix - {"MAJOR_VERSION", {"hipLibraryMajorVersion", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"MINOR_VERSION", {"hipLibraryMinorVersion", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"PATCH_LEVEL", {"hipLibraryPatchVersion", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"MAJOR_VERSION", {"hipLibraryMajorVersion", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"MINOR_VERSION", {"hipLibraryMinorVersion", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"PATCH_LEVEL", {"hipLibraryPatchVersion", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // defines - {"cudaMemAttachGlobal", {"hipMemAttachGlobal", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x01 // API_Driver ANALOGUE (CU_MEM_ATTACH_GLOBAL = 0x1) - {"cudaMemAttachHost", {"hipMemAttachHost", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x02 // API_Driver ANALOGUE (CU_MEM_ATTACH_HOST = 0x2) - {"cudaMemAttachSingle", {"hipMemAttachSingle", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x04 // API_Driver ANALOGUE (CU_MEM_ATTACH_SINGLE = 0x4) + {"cudaMemAttachGlobal", + {"hipMemAttachGlobal", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x01 // API_Driver ANALOGUE (CU_MEM_ATTACH_GLOBAL = 0x1) + {"cudaMemAttachHost", + {"hipMemAttachHost", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x02 // API_Driver ANALOGUE (CU_MEM_ATTACH_HOST = 0x2) + {"cudaMemAttachSingle", + {"hipMemAttachSingle", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x04 // API_Driver ANALOGUE (CU_MEM_ATTACH_SINGLE = 0x4) - {"cudaOccupancyDefault", {"hipOccupancyDefault", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x00 // API_Driver ANALOGUE (CU_OCCUPANCY_DEFAULT = 0x0) - {"cudaOccupancyDisableCachingOverride", {"hipOccupancyDisableCachingOverride", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x01 // API_Driver ANALOGUE (CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE = 0x1) + {"cudaOccupancyDefault", + {"hipOccupancyDefault", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x00 // API_Driver ANALOGUE (CU_OCCUPANCY_DEFAULT = 0x0) + {"cudaOccupancyDisableCachingOverride", + {"hipOccupancyDisableCachingOverride", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x01 // API_Driver ANALOGUE (CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE = + // 0x1) // Error API - {"cudaGetLastError", {"hipGetLastError", CONV_ERROR, API_RUNTIME}}, + {"cudaGetLastError", {"hipGetLastError", CONV_ERROR, API_RUNTIME}}, {"cudaPeekAtLastError", {"hipPeekAtLastError", CONV_ERROR, API_RUNTIME}}, - {"cudaGetErrorName", {"hipGetErrorName", CONV_ERROR, API_RUNTIME}}, - {"cudaGetErrorString", {"hipGetErrorString", CONV_ERROR, API_RUNTIME}}, + {"cudaGetErrorName", {"hipGetErrorName", CONV_ERROR, API_RUNTIME}}, + {"cudaGetErrorString", {"hipGetErrorString", CONV_ERROR, API_RUNTIME}}, // memcpy // memcpy structs - {"cudaMemcpy3DParms", {"hipMemcpy3DParms", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpy3DParms", {"hipMemcpy3DParms", CONV_MEM, API_RUNTIME}}, {"cudaMemcpy3DPeerParms", {"hipMemcpy3DPeerParms", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, // memcpy functions - {"cudaMemcpy", {"hipMemcpy", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpyToArray", {"hipMemcpyToArray", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpyToSymbol", {"hipMemcpyToSymbol", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpyToSymbolAsync", {"hipMemcpyToSymbolAsync", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpyAsync", {"hipMemcpyAsync", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpy2D", {"hipMemcpy2D", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpy2DAsync", {"hipMemcpy2DAsync", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpy2DToArray", {"hipMemcpy2DToArray", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpy2DArrayToArray", {"hipMemcpy2DArrayToArray", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMemcpy2DFromArray", {"hipMemcpy2DFromArray", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMemcpy2DFromArrayAsync", {"hipMemcpy2DFromArrayAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMemcpy2DToArrayAsync", {"hipMemcpy2DToArrayAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMemcpy3D", {"hipMemcpy3D", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpy3DAsync", {"hipMemcpy3DAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMemcpy3DPeer", {"hipMemcpy3DPeer", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMemcpy3DPeerAsync", {"hipMemcpy3DPeerAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMemcpyArrayToArray", {"hipMemcpyArrayToArray", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMemcpyFromArrayAsync", {"hipMemcpyFromArrayAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMemcpyFromSymbol", {"hipMemcpyFromSymbol", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpyFromSymbolAsync", {"hipMemcpyFromSymbolAsync", CONV_MEM, API_RUNTIME}}, - {"cudaMemAdvise", {"hipMemAdvise", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, // - {"cudaMemRangeGetAttribute", {"hipMemRangeGetAttribute", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, // - {"cudaMemRangeGetAttributes", {"hipMemRangeGetAttributes", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, // + {"cudaMemcpy", {"hipMemcpy", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpyToArray", {"hipMemcpyToArray", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpyToSymbol", {"hipMemcpyToSymbol", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpyToSymbolAsync", {"hipMemcpyToSymbolAsync", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpyAsync", {"hipMemcpyAsync", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpy2D", {"hipMemcpy2D", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpy2DAsync", {"hipMemcpy2DAsync", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpy2DToArray", {"hipMemcpy2DToArray", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpy2DArrayToArray", + {"hipMemcpy2DArrayToArray", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMemcpy2DFromArray", {"hipMemcpy2DFromArray", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMemcpy2DFromArrayAsync", + {"hipMemcpy2DFromArrayAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMemcpy2DToArrayAsync", + {"hipMemcpy2DToArrayAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMemcpy3D", {"hipMemcpy3D", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpy3DAsync", {"hipMemcpy3DAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMemcpy3DPeer", {"hipMemcpy3DPeer", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMemcpy3DPeerAsync", {"hipMemcpy3DPeerAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMemcpyArrayToArray", {"hipMemcpyArrayToArray", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMemcpyFromArrayAsync", + {"hipMemcpyFromArrayAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMemcpyFromSymbol", {"hipMemcpyFromSymbol", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpyFromSymbolAsync", {"hipMemcpyFromSymbolAsync", CONV_MEM, API_RUNTIME}}, + {"cudaMemAdvise", {"hipMemAdvise", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, // + {"cudaMemRangeGetAttribute", + {"hipMemRangeGetAttribute", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, // + {"cudaMemRangeGetAttributes", + {"hipMemRangeGetAttributes", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, // // Memory advise values - {"cudaMemAdviseSetReadMostly", {"hipMemAdviseSetReadMostly", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_MEM_ADVISE_SET_READ_MOSTLY = 1) - {"cudaMemAdviseUnsetReadMostly", {"hipMemAdviseUnsetReadMostly", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_MEM_ADVISE_UNSET_READ_MOSTLY = 2) - {"cudaMemAdviseSetPreferredLocation", {"hipMemAdviseSetPreferredLocation", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 3 // API_Driver ANALOGUE (CU_MEM_ADVISE_SET_PREFERRED_LOCATION = 3) - {"cudaMemAdviseUnsetPreferredLocation", {"hipMemAdviseUnsetPreferredLocation", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 4 // API_Driver ANALOGUE (CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION = 4) - {"cudaMemAdviseSetAccessedBy", {"hipMemAdviseSetAccessedBy", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 5 // API_Driver ANALOGUE (CU_MEM_ADVISE_SET_ACCESSED_BY = 5) - {"cudaMemAdviseUnsetAccessedBy", {"hipMemAdviseUnsetAccessedBy", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 6 // API_Driver ANALOGUE (CU_MEM_ADVISE_UNSET_ACCESSED_BY = 6) + {"cudaMemAdviseSetReadMostly", + {"hipMemAdviseSetReadMostly", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_MEM_ADVISE_SET_READ_MOSTLY = 1) + {"cudaMemAdviseUnsetReadMostly", + {"hipMemAdviseUnsetReadMostly", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_MEM_ADVISE_UNSET_READ_MOSTLY = 2) + {"cudaMemAdviseSetPreferredLocation", + {"hipMemAdviseSetPreferredLocation", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 3 // API_Driver ANALOGUE (CU_MEM_ADVISE_SET_PREFERRED_LOCATION = 3) + {"cudaMemAdviseUnsetPreferredLocation", + {"hipMemAdviseUnsetPreferredLocation", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 4 // API_Driver ANALOGUE (CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION = 4) + {"cudaMemAdviseSetAccessedBy", + {"hipMemAdviseSetAccessedBy", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 5 // API_Driver ANALOGUE (CU_MEM_ADVISE_SET_ACCESSED_BY = 5) + {"cudaMemAdviseUnsetAccessedBy", + {"hipMemAdviseUnsetAccessedBy", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 6 // API_Driver ANALOGUE (CU_MEM_ADVISE_UNSET_ACCESSED_BY = 6) // CUmem_range_attribute - {"cudaMemRangeAttributeReadMostly", {"hipMemRangeAttributeReadMostly", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY = 1) - {"cudaMemRangeAttributePreferredLocation", {"hipMemRangeAttributePreferredLocation", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION = 2) - {"cudaMemRangeAttributeAccessedBy", {"hipMemRangeAttributeAccessedBy", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 3 // API_Driver ANALOGUE (CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY = 3) - {"cudaMemRangeAttributeLastPrefetchLocation", {"hipMemRangeAttributeLastPrefetchLocation", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 4 // API_Driver ANALOGUE (CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION = 4) + {"cudaMemRangeAttributeReadMostly", + {"hipMemRangeAttributeReadMostly", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY = 1) + {"cudaMemRangeAttributePreferredLocation", + {"hipMemRangeAttributePreferredLocation", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION = + // 2) + {"cudaMemRangeAttributeAccessedBy", + {"hipMemRangeAttributeAccessedBy", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 3 // API_Driver ANALOGUE (CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY = 3) + {"cudaMemRangeAttributeLastPrefetchLocation", + {"hipMemRangeAttributeLastPrefetchLocation", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 4 // API_Driver ANALOGUE (CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION + // = 4) // memcpy kind - {"cudaMemcpyHostToHost", {"hipMemcpyHostToHost", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpyHostToDevice", {"hipMemcpyHostToDevice", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpyDeviceToHost", {"hipMemcpyDeviceToHost", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpyHostToHost", {"hipMemcpyHostToHost", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpyHostToDevice", {"hipMemcpyHostToDevice", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpyDeviceToHost", {"hipMemcpyDeviceToHost", CONV_MEM, API_RUNTIME}}, {"cudaMemcpyDeviceToDevice", {"hipMemcpyDeviceToDevice", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpyDefault", {"hipMemcpyDefault", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpyDefault", {"hipMemcpyDefault", CONV_MEM, API_RUNTIME}}, // memset - {"cudaMemset", {"hipMemset", CONV_MEM, API_RUNTIME}}, - {"cudaMemsetAsync", {"hipMemsetAsync", CONV_MEM, API_RUNTIME}}, - {"cudaMemset2D", {"hipMemset2D", CONV_MEM, API_RUNTIME}}, + {"cudaMemset", {"hipMemset", CONV_MEM, API_RUNTIME}}, + {"cudaMemsetAsync", {"hipMemsetAsync", CONV_MEM, API_RUNTIME}}, + {"cudaMemset2D", {"hipMemset2D", CONV_MEM, API_RUNTIME}}, {"cudaMemset2DAsync", {"hipMemset2DAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMemset3D", {"hipMemset3D", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMemset3D", {"hipMemset3D", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, {"cudaMemset3DAsync", {"hipMemset3DAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, // Memory management - {"cudaMemGetInfo", {"hipMemGetInfo", CONV_MEM, API_RUNTIME}}, - {"cudaArrayGetInfo", {"hipArrayGetInfo", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaFreeMipmappedArray", {"hipFreeMipmappedArray", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGetMipmappedArrayLevel", {"hipGetMipmappedArrayLevel", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGetSymbolAddress", {"hipGetSymbolAddress", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGetSymbolSize", {"hipGetSymbolSize", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMemPrefetchAsync", {"hipMemPrefetchAsync", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, // // API_Driver ANALOGUE (cuMemPrefetchAsync) + {"cudaMemGetInfo", {"hipMemGetInfo", CONV_MEM, API_RUNTIME}}, + {"cudaArrayGetInfo", {"hipArrayGetInfo", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaFreeMipmappedArray", {"hipFreeMipmappedArray", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGetMipmappedArrayLevel", + {"hipGetMipmappedArrayLevel", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGetSymbolAddress", {"hipGetSymbolAddress", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGetSymbolSize", {"hipGetSymbolSize", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMemPrefetchAsync", + {"hipMemPrefetchAsync", CONV_MEM, API_RUNTIME, + HIP_UNSUPPORTED}}, // // API_Driver ANALOGUE (cuMemPrefetchAsync) // malloc - {"cudaMalloc", {"hipMalloc", CONV_MEM, API_RUNTIME}}, - {"cudaMallocHost", {"hipHostMalloc", CONV_MEM, API_RUNTIME}}, - {"cudaMallocArray", {"hipMallocArray", CONV_MEM, API_RUNTIME}}, - {"cudaMalloc3D", {"hipMalloc3D", CONV_MEM, API_RUNTIME}}, - {"cudaMalloc3DArray", {"hipMalloc3DArray", CONV_MEM, API_RUNTIME}}, - {"cudaMallocManaged", {"hipMallocManaged", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMallocMipmappedArray", {"hipMallocMipmappedArray", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaMallocPitch", {"hipMallocPitch", CONV_MEM, API_RUNTIME}}, + {"cudaMalloc", {"hipMalloc", CONV_MEM, API_RUNTIME}}, + {"cudaMallocHost", {"hipHostMalloc", CONV_MEM, API_RUNTIME}}, + {"cudaMallocArray", {"hipMallocArray", CONV_MEM, API_RUNTIME}}, + {"cudaMalloc3D", {"hipMalloc3D", CONV_MEM, API_RUNTIME}}, + {"cudaMalloc3DArray", {"hipMalloc3DArray", CONV_MEM, API_RUNTIME}}, + {"cudaMallocManaged", {"hipMallocManaged", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMallocMipmappedArray", + {"hipMallocMipmappedArray", CONV_MEM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaMallocPitch", {"hipMallocPitch", CONV_MEM, API_RUNTIME}}, - {"cudaFree", {"hipFree", CONV_MEM, API_RUNTIME}}, - {"cudaFreeHost", {"hipHostFree", CONV_MEM, API_RUNTIME}}, - {"cudaFreeArray", {"hipFreeArray", CONV_MEM, API_RUNTIME}}, - {"cudaHostRegister", {"hipHostRegister", CONV_MEM, API_RUNTIME}}, + {"cudaFree", {"hipFree", CONV_MEM, API_RUNTIME}}, + {"cudaFreeHost", {"hipHostFree", CONV_MEM, API_RUNTIME}}, + {"cudaFreeArray", {"hipFreeArray", CONV_MEM, API_RUNTIME}}, + {"cudaHostRegister", {"hipHostRegister", CONV_MEM, API_RUNTIME}}, {"cudaHostUnregister", {"hipHostUnregister", CONV_MEM, API_RUNTIME}}, // hipHostAlloc deprecated - use hipHostMalloc instead - {"cudaHostAlloc", {"hipHostMalloc", CONV_MEM, API_RUNTIME}}, + {"cudaHostAlloc", {"hipHostMalloc", CONV_MEM, API_RUNTIME}}, // enum cudaMemoryType - {"cudaMemoryTypeHost", {"hipMemoryTypeHost", CONV_MEM, API_RUNTIME}}, + {"cudaMemoryTypeHost", {"hipMemoryTypeHost", CONV_MEM, API_RUNTIME}}, {"cudaMemoryTypeDevice", {"hipMemoryTypeDevice", CONV_MEM, API_RUNTIME}}, // make memory functions - {"make_cudaExtent", {"make_hipExtent", CONV_MEM, API_RUNTIME}}, + {"make_cudaExtent", {"make_hipExtent", CONV_MEM, API_RUNTIME}}, {"make_cudaPitchedPtr", {"make_hipPitchedPtr", CONV_MEM, API_RUNTIME}}, - {"make_cudaPos", {"make_hipPos", CONV_MEM, API_RUNTIME}}, + {"make_cudaPos", {"make_hipPos", CONV_MEM, API_RUNTIME}}, // Host Malloc Flags (#defines) - {"cudaHostAllocDefault", {"hipHostMallocDefault", CONV_MEM, API_RUNTIME}}, - {"cudaHostAllocPortable", {"hipHostMallocPortable", CONV_MEM, API_RUNTIME}}, - {"cudaHostAllocMapped", {"hipHostMallocMapped", CONV_MEM, API_RUNTIME}}, + {"cudaHostAllocDefault", {"hipHostMallocDefault", CONV_MEM, API_RUNTIME}}, + {"cudaHostAllocPortable", {"hipHostMallocPortable", CONV_MEM, API_RUNTIME}}, + {"cudaHostAllocMapped", {"hipHostMallocMapped", CONV_MEM, API_RUNTIME}}, {"cudaHostAllocWriteCombined", {"hipHostMallocWriteCombined", CONV_MEM, API_RUNTIME}}, // Host Register Flags - {"cudaHostGetFlags", {"hipHostGetFlags", CONV_MEM, API_RUNTIME}}, - {"cudaHostRegisterDefault", {"hipHostRegisterDefault", CONV_MEM, API_RUNTIME}}, + {"cudaHostGetFlags", {"hipHostGetFlags", CONV_MEM, API_RUNTIME}}, + {"cudaHostRegisterDefault", {"hipHostRegisterDefault", CONV_MEM, API_RUNTIME}}, {"cudaHostRegisterPortable", {"hipHostRegisterPortable", CONV_MEM, API_RUNTIME}}, - {"cudaHostRegisterMapped", {"hipHostRegisterMapped", CONV_MEM, API_RUNTIME}}, + {"cudaHostRegisterMapped", {"hipHostRegisterMapped", CONV_MEM, API_RUNTIME}}, {"cudaHostRegisterIoMemory", {"hipHostRegisterIoMemory", CONV_MEM, API_RUNTIME}}, - {"warpSize", {"hipWarpSize", CONV_SPECIAL_FUNC, API_RUNTIME}}, + {"warpSize", {"hipWarpSize", CONV_SPECIAL_FUNC, API_RUNTIME}}, // Events - {"cudaEventCreate", {"hipEventCreate", CONV_EVENT, API_RUNTIME}}, - {"cudaEventCreateWithFlags", {"hipEventCreateWithFlags", CONV_EVENT, API_RUNTIME}}, - {"cudaEventDestroy", {"hipEventDestroy", CONV_EVENT, API_RUNTIME}}, - {"cudaEventRecord", {"hipEventRecord", CONV_EVENT, API_RUNTIME}}, - {"cudaEventElapsedTime", {"hipEventElapsedTime", CONV_EVENT, API_RUNTIME}}, - {"cudaEventSynchronize", {"hipEventSynchronize", CONV_EVENT, API_RUNTIME}}, - {"cudaEventQuery", {"hipEventQuery", CONV_EVENT, API_RUNTIME}}, + {"cudaEventCreate", {"hipEventCreate", CONV_EVENT, API_RUNTIME}}, + {"cudaEventCreateWithFlags", {"hipEventCreateWithFlags", CONV_EVENT, API_RUNTIME}}, + {"cudaEventDestroy", {"hipEventDestroy", CONV_EVENT, API_RUNTIME}}, + {"cudaEventRecord", {"hipEventRecord", CONV_EVENT, API_RUNTIME}}, + {"cudaEventElapsedTime", {"hipEventElapsedTime", CONV_EVENT, API_RUNTIME}}, + {"cudaEventSynchronize", {"hipEventSynchronize", CONV_EVENT, API_RUNTIME}}, + {"cudaEventQuery", {"hipEventQuery", CONV_EVENT, API_RUNTIME}}, // Event Flags - {"cudaEventDefault", {"hipEventDefault", CONV_EVENT, API_RUNTIME}}, - {"cudaEventBlockingSync", {"hipEventBlockingSync", CONV_EVENT, API_RUNTIME}}, - {"cudaEventDisableTiming", {"hipEventDisableTiming", CONV_EVENT, API_RUNTIME}}, - {"cudaEventInterprocess", {"hipEventInterprocess", CONV_EVENT, API_RUNTIME}}, + {"cudaEventDefault", {"hipEventDefault", CONV_EVENT, API_RUNTIME}}, + {"cudaEventBlockingSync", {"hipEventBlockingSync", CONV_EVENT, API_RUNTIME}}, + {"cudaEventDisableTiming", {"hipEventDisableTiming", CONV_EVENT, API_RUNTIME}}, + {"cudaEventInterprocess", {"hipEventInterprocess", CONV_EVENT, API_RUNTIME}}, // Streams - {"cudaStreamCreate", {"hipStreamCreate", CONV_STREAM, API_RUNTIME}}, - {"cudaStreamCreateWithFlags", {"hipStreamCreateWithFlags", CONV_STREAM, API_RUNTIME}}, - {"cudaStreamCreateWithPriority", {"hipStreamCreateWithPriority", CONV_STREAM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaStreamDestroy", {"hipStreamDestroy", CONV_STREAM, API_RUNTIME}}, - {"cudaStreamWaitEvent", {"hipStreamWaitEvent", CONV_STREAM, API_RUNTIME}}, - {"cudaStreamSynchronize", {"hipStreamSynchronize", CONV_STREAM, API_RUNTIME}}, - {"cudaStreamGetFlags", {"hipStreamGetFlags", CONV_STREAM, API_RUNTIME}}, - {"cudaStreamQuery", {"hipStreamQuery", CONV_STREAM, API_RUNTIME}}, - {"cudaStreamAddCallback", {"hipStreamAddCallback", CONV_STREAM, API_RUNTIME}}, - {"cudaStreamAttachMemAsync", {"hipStreamAttachMemAsync", CONV_STREAM, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaStreamGetPriority", {"hipStreamGetPriority", CONV_STREAM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaStreamCreate", {"hipStreamCreate", CONV_STREAM, API_RUNTIME}}, + {"cudaStreamCreateWithFlags", {"hipStreamCreateWithFlags", CONV_STREAM, API_RUNTIME}}, + {"cudaStreamCreateWithPriority", + {"hipStreamCreateWithPriority", CONV_STREAM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaStreamDestroy", {"hipStreamDestroy", CONV_STREAM, API_RUNTIME}}, + {"cudaStreamWaitEvent", {"hipStreamWaitEvent", CONV_STREAM, API_RUNTIME}}, + {"cudaStreamSynchronize", {"hipStreamSynchronize", CONV_STREAM, API_RUNTIME}}, + {"cudaStreamGetFlags", {"hipStreamGetFlags", CONV_STREAM, API_RUNTIME}}, + {"cudaStreamQuery", {"hipStreamQuery", CONV_STREAM, API_RUNTIME}}, + {"cudaStreamAddCallback", {"hipStreamAddCallback", CONV_STREAM, API_RUNTIME}}, + {"cudaStreamAttachMemAsync", + {"hipStreamAttachMemAsync", CONV_STREAM, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaStreamGetPriority", {"hipStreamGetPriority", CONV_STREAM, API_RUNTIME, HIP_UNSUPPORTED}}, // Stream Flags (defines) - {"cudaStreamDefault", {"hipStreamDefault", CONV_TYPE, API_RUNTIME}}, + {"cudaStreamDefault", {"hipStreamDefault", CONV_TYPE, API_RUNTIME}}, {"cudaStreamNonBlocking", {"hipStreamNonBlocking", CONV_TYPE, API_RUNTIME}}, // Other synchronization {"cudaDeviceSynchronize", {"hipDeviceSynchronize", CONV_DEVICE, API_RUNTIME}}, - {"cudaDeviceReset", {"hipDeviceReset", CONV_DEVICE, API_RUNTIME}}, - {"cudaSetDevice", {"hipSetDevice", CONV_DEVICE, API_RUNTIME}}, - {"cudaGetDevice", {"hipGetDevice", CONV_DEVICE, API_RUNTIME}}, - {"cudaGetDeviceCount", {"hipGetDeviceCount", CONV_DEVICE, API_RUNTIME}}, - {"cudaChooseDevice", {"hipChooseDevice", CONV_DEVICE, API_RUNTIME}}, + {"cudaDeviceReset", {"hipDeviceReset", CONV_DEVICE, API_RUNTIME}}, + {"cudaSetDevice", {"hipSetDevice", CONV_DEVICE, API_RUNTIME}}, + {"cudaGetDevice", {"hipGetDevice", CONV_DEVICE, API_RUNTIME}}, + {"cudaGetDeviceCount", {"hipGetDeviceCount", CONV_DEVICE, API_RUNTIME}}, + {"cudaChooseDevice", {"hipChooseDevice", CONV_DEVICE, API_RUNTIME}}, // Thread Management - {"cudaThreadExit", {"hipDeviceReset", CONV_THREAD, API_RUNTIME}}, + {"cudaThreadExit", {"hipDeviceReset", CONV_THREAD, API_RUNTIME}}, {"cudaThreadGetCacheConfig", {"hipDeviceGetCacheConfig", CONV_THREAD, API_RUNTIME}}, - {"cudaThreadGetLimit", {"hipThreadGetLimit", CONV_THREAD, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaThreadGetLimit", {"hipThreadGetLimit", CONV_THREAD, API_RUNTIME, HIP_UNSUPPORTED}}, {"cudaThreadSetCacheConfig", {"hipDeviceSetCacheConfig", CONV_THREAD, API_RUNTIME}}, - {"cudaThreadSetLimit", {"hipThreadSetLimit", CONV_THREAD, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaThreadSynchronize", {"hipDeviceSynchronize", CONV_THREAD, API_RUNTIME}}, + {"cudaThreadSetLimit", {"hipThreadSetLimit", CONV_THREAD, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaThreadSynchronize", {"hipDeviceSynchronize", CONV_THREAD, API_RUNTIME}}, // Attributes - {"cudaDeviceGetAttribute", {"hipDeviceGetAttribute", CONV_DEVICE, API_RUNTIME}}, + {"cudaDeviceGetAttribute", {"hipDeviceGetAttribute", CONV_DEVICE, API_RUNTIME}}, // enum cudaDeviceAttr - {"cudaDevAttrMaxThreadsPerBlock", {"hipDeviceAttributeMaxThreadsPerBlock", CONV_TYPE, API_RUNTIME}}, // 1 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1) - {"cudaDevAttrMaxBlockDimX", {"hipDeviceAttributeMaxBlockDimX", CONV_TYPE, API_RUNTIME}}, // 2 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2) - {"cudaDevAttrMaxBlockDimY", {"hipDeviceAttributeMaxBlockDimY", CONV_TYPE, API_RUNTIME}}, // 3 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = 3) - {"cudaDevAttrMaxBlockDimZ", {"hipDeviceAttributeMaxBlockDimZ", CONV_TYPE, API_RUNTIME}}, // 4 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z = 4) - {"cudaDevAttrMaxGridDimX", {"hipDeviceAttributeMaxGridDimX", CONV_TYPE, API_RUNTIME}}, // 5 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 5) - {"cudaDevAttrMaxGridDimY", {"hipDeviceAttributeMaxGridDimY", CONV_TYPE, API_RUNTIME}}, // 6 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 6) - {"cudaDevAttrMaxGridDimZ", {"hipDeviceAttributeMaxGridDimZ", CONV_TYPE, API_RUNTIME}}, // 7 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 7) - {"cudaDevAttrMaxSharedMemoryPerBlock", {"hipDeviceAttributeMaxSharedMemoryPerBlock", CONV_TYPE, API_RUNTIME}}, // 8 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK = 8) - {"cudaDevAttrTotalConstantMemory", {"hipDeviceAttributeTotalConstantMemory", CONV_TYPE, API_RUNTIME}}, // 9 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY =9) - {"cudaDevAttrWarpSize", {"hipDeviceAttributeWarpSize", CONV_TYPE, API_RUNTIME}}, // 10 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_WARP_SIZE = 10) - {"cudaDevAttrMaxPitch", {"hipDeviceAttributeMaxPitch", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 11 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_PITCH = 11) - {"cudaDevAttrMaxRegistersPerBlock", {"hipDeviceAttributeMaxRegistersPerBlock", CONV_TYPE, API_RUNTIME}}, // 12 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK = 12) - {"cudaDevAttrClockRate", {"hipDeviceAttributeClockRate", CONV_TYPE, API_RUNTIME}}, // 13 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_CLOCK_RATE = 13) - {"cudaDevAttrTextureAlignment", {"hipDeviceAttributeTextureAlignment", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 14 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = 14) + {"cudaDevAttrMaxThreadsPerBlock", + {"hipDeviceAttributeMaxThreadsPerBlock", CONV_TYPE, + API_RUNTIME}}, // 1 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1) + {"cudaDevAttrMaxBlockDimX", + {"hipDeviceAttributeMaxBlockDimX", CONV_TYPE, + API_RUNTIME}}, // 2 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2) + {"cudaDevAttrMaxBlockDimY", + {"hipDeviceAttributeMaxBlockDimY", CONV_TYPE, + API_RUNTIME}}, // 3 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = 3) + {"cudaDevAttrMaxBlockDimZ", + {"hipDeviceAttributeMaxBlockDimZ", CONV_TYPE, + API_RUNTIME}}, // 4 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z = 4) + {"cudaDevAttrMaxGridDimX", + {"hipDeviceAttributeMaxGridDimX", CONV_TYPE, + API_RUNTIME}}, // 5 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 5) + {"cudaDevAttrMaxGridDimY", + {"hipDeviceAttributeMaxGridDimY", CONV_TYPE, + API_RUNTIME}}, // 6 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 6) + {"cudaDevAttrMaxGridDimZ", + {"hipDeviceAttributeMaxGridDimZ", CONV_TYPE, + API_RUNTIME}}, // 7 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 7) + {"cudaDevAttrMaxSharedMemoryPerBlock", + {"hipDeviceAttributeMaxSharedMemoryPerBlock", CONV_TYPE, + API_RUNTIME}}, // 8 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK + // = 8) + {"cudaDevAttrTotalConstantMemory", + {"hipDeviceAttributeTotalConstantMemory", CONV_TYPE, + API_RUNTIME}}, // 9 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY =9) + {"cudaDevAttrWarpSize", + {"hipDeviceAttributeWarpSize", CONV_TYPE, + API_RUNTIME}}, // 10 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_WARP_SIZE = 10) + {"cudaDevAttrMaxPitch", + {"hipDeviceAttributeMaxPitch", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 11 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_PITCH = 11) + {"cudaDevAttrMaxRegistersPerBlock", + {"hipDeviceAttributeMaxRegistersPerBlock", CONV_TYPE, + API_RUNTIME}}, // 12 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK = + // 12) + {"cudaDevAttrClockRate", + {"hipDeviceAttributeClockRate", CONV_TYPE, + API_RUNTIME}}, // 13 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_CLOCK_RATE = 13) + {"cudaDevAttrTextureAlignment", + {"hipDeviceAttributeTextureAlignment", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 14 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = 14) // Is not deprecated as CUDA Driver's API analogue CU_DEVICE_ATTRIBUTE_GPU_OVERLAP - {"cudaDevAttrGpuOverlap", {"hipDeviceAttributeGpuOverlap", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 15 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_GPU_OVERLAP = 15) - {"cudaDevAttrMultiProcessorCount", {"hipDeviceAttributeMultiprocessorCount", CONV_TYPE, API_RUNTIME}}, // 16 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = 16) - {"cudaDevAttrKernelExecTimeout", {"hipDeviceAttributeKernelExecTimeout", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 17 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT = 17) - {"cudaDevAttrIntegrated", {"hipDeviceAttributeIntegrated", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 18 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_INTEGRATED = 18) - {"cudaDevAttrCanMapHostMemory", {"hipDeviceAttributeCanMapHostMemory", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 19 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY = 19) - {"cudaDevAttrComputeMode", {"hipDeviceAttributeComputeMode", CONV_TYPE, API_RUNTIME}}, // 20 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_COMPUTE_MODE = 20) - {"cudaDevAttrMaxTexture1DWidth", {"hipDeviceAttributeMaxTexture1DWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 21 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH = 21) - {"cudaDevAttrMaxTexture2DWidth", {"hipDeviceAttributeMaxTexture2DWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 22 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH = 22) - {"cudaDevAttrMaxTexture2DHeight", {"hipDeviceAttributeMaxTexture2DHeight", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 23 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT = 23) - {"cudaDevAttrMaxTexture3DWidth", {"hipDeviceAttributeMaxTexture3DWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 24 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH = 24) - {"cudaDevAttrMaxTexture3DHeight", {"hipDeviceAttributeMaxTexture3DHeight", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 25 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT = 25) - {"cudaDevAttrMaxTexture3DDepth", {"hipDeviceAttributeMaxTexture3DDepth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 26 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH = 26) - {"cudaDevAttrMaxTexture2DLayeredWidth", {"hipDeviceAttributeMaxTexture2DLayeredWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 27 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH = 27) - {"cudaDevAttrMaxTexture2DLayeredHeight", {"hipDeviceAttributeMaxTexture2DLayeredHeight", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 28 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT = 28) - {"cudaDevAttrMaxTexture2DLayeredLayers", {"hipDeviceAttributeMaxTexture2DLayeredLayers", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 29 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS = 29) - {"cudaDevAttrSurfaceAlignment", {"hipDeviceAttributeSurfaceAlignment", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 30 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT = 30) - {"cudaDevAttrConcurrentKernels", {"hipDeviceAttributeConcurrentKernels", CONV_TYPE, API_RUNTIME}}, // 31 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS = 31) - {"cudaDevAttrEccEnabled", {"hipDeviceAttributeEccEnabled", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 32 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_ECC_ENABLED = 32) - {"cudaDevAttrPciBusId", {"hipDeviceAttributePciBusId", CONV_TYPE, API_RUNTIME}}, // 33 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_PCI_BUS_ID = 33) - {"cudaDevAttrPciDeviceId", {"hipDeviceAttributePciDeviceId", CONV_TYPE, API_RUNTIME}}, // 34 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID = 34) - {"cudaDevAttrTccDriver", {"hipDeviceAttributeTccDriver", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 35 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_TCC_DRIVER = 35) - {"cudaDevAttrMemoryClockRate", {"hipDeviceAttributeMemoryClockRate", CONV_TYPE, API_RUNTIME}}, // 36 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE = 36) - {"cudaDevAttrGlobalMemoryBusWidth", {"hipDeviceAttributeMemoryBusWidth", CONV_TYPE, API_RUNTIME}}, // 37 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH = 37) - {"cudaDevAttrL2CacheSize", {"hipDeviceAttributeL2CacheSize", CONV_TYPE, API_RUNTIME}}, // 38 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE = 38) - {"cudaDevAttrMaxThreadsPerMultiProcessor", {"hipDeviceAttributeMaxThreadsPerMultiProcessor", CONV_TYPE, API_RUNTIME}}, // 39 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR = 39) - {"cudaDevAttrAsyncEngineCount", {"hipDeviceAttributeAsyncEngineCount", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 40 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT = 40) - {"cudaDevAttrUnifiedAddressing", {"hipDeviceAttributeUnifiedAddressing", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 41 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING = 41) - {"cudaDevAttrMaxTexture1DLayeredWidth", {"hipDeviceAttributeMaxTexture1DLayeredWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 42 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH = 42) - {"cudaDevAttrMaxTexture1DLayeredLayers", {"hipDeviceAttributeMaxTexture1DLayeredLayers", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 43 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS = 43) + {"cudaDevAttrGpuOverlap", + {"hipDeviceAttributeGpuOverlap", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 15 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_GPU_OVERLAP = 15) + {"cudaDevAttrMultiProcessorCount", + {"hipDeviceAttributeMultiprocessorCount", CONV_TYPE, + API_RUNTIME}}, // 16 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = 16) + {"cudaDevAttrKernelExecTimeout", + {"hipDeviceAttributeKernelExecTimeout", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 17 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT = + // 17) + {"cudaDevAttrIntegrated", + {"hipDeviceAttributeIntegrated", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 18 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_INTEGRATED = 18) + {"cudaDevAttrCanMapHostMemory", + {"hipDeviceAttributeCanMapHostMemory", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 19 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY = + // 19) + {"cudaDevAttrComputeMode", + {"hipDeviceAttributeComputeMode", CONV_TYPE, + API_RUNTIME}}, // 20 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_COMPUTE_MODE = 20) + {"cudaDevAttrMaxTexture1DWidth", + {"hipDeviceAttributeMaxTexture1DWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 21 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH + // = 21) + {"cudaDevAttrMaxTexture2DWidth", + {"hipDeviceAttributeMaxTexture2DWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 22 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH + // = 22) + {"cudaDevAttrMaxTexture2DHeight", + {"hipDeviceAttributeMaxTexture2DHeight", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 23 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT + // = 23) + {"cudaDevAttrMaxTexture3DWidth", + {"hipDeviceAttributeMaxTexture3DWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 24 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH + // = 24) + {"cudaDevAttrMaxTexture3DHeight", + {"hipDeviceAttributeMaxTexture3DHeight", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 25 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT + // = 25) + {"cudaDevAttrMaxTexture3DDepth", + {"hipDeviceAttributeMaxTexture3DDepth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 26 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH + // = 26) + {"cudaDevAttrMaxTexture2DLayeredWidth", + {"hipDeviceAttributeMaxTexture2DLayeredWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 27 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH = 27) + {"cudaDevAttrMaxTexture2DLayeredHeight", + {"hipDeviceAttributeMaxTexture2DLayeredHeight", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 28 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT = 28) + {"cudaDevAttrMaxTexture2DLayeredLayers", + {"hipDeviceAttributeMaxTexture2DLayeredLayers", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 29 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS = 29) + {"cudaDevAttrSurfaceAlignment", + {"hipDeviceAttributeSurfaceAlignment", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 30 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT = 30) + {"cudaDevAttrConcurrentKernels", + {"hipDeviceAttributeConcurrentKernels", CONV_TYPE, + API_RUNTIME}}, // 31 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS = 31) + {"cudaDevAttrEccEnabled", + {"hipDeviceAttributeEccEnabled", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 32 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_ECC_ENABLED = 32) + {"cudaDevAttrPciBusId", + {"hipDeviceAttributePciBusId", CONV_TYPE, + API_RUNTIME}}, // 33 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_PCI_BUS_ID = 33) + {"cudaDevAttrPciDeviceId", + {"hipDeviceAttributePciDeviceId", CONV_TYPE, + API_RUNTIME}}, // 34 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID = 34) + {"cudaDevAttrTccDriver", + {"hipDeviceAttributeTccDriver", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 35 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_TCC_DRIVER = 35) + {"cudaDevAttrMemoryClockRate", + {"hipDeviceAttributeMemoryClockRate", CONV_TYPE, + API_RUNTIME}}, // 36 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE = 36) + {"cudaDevAttrGlobalMemoryBusWidth", + {"hipDeviceAttributeMemoryBusWidth", CONV_TYPE, + API_RUNTIME}}, // 37 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH = + // 37) + {"cudaDevAttrL2CacheSize", + {"hipDeviceAttributeL2CacheSize", CONV_TYPE, + API_RUNTIME}}, // 38 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE = 38) + {"cudaDevAttrMaxThreadsPerMultiProcessor", + {"hipDeviceAttributeMaxThreadsPerMultiProcessor", CONV_TYPE, + API_RUNTIME}}, // 39 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR = 39) + {"cudaDevAttrAsyncEngineCount", + {"hipDeviceAttributeAsyncEngineCount", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 40 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT = 40) + {"cudaDevAttrUnifiedAddressing", + {"hipDeviceAttributeUnifiedAddressing", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 41 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING = 41) + {"cudaDevAttrMaxTexture1DLayeredWidth", + {"hipDeviceAttributeMaxTexture1DLayeredWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 42 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH = 42) + {"cudaDevAttrMaxTexture1DLayeredLayers", + {"hipDeviceAttributeMaxTexture1DLayeredLayers", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 43 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS = 43) // 44 - no - {"cudaDevAttrMaxTexture2DGatherWidth", {"hipDeviceAttributeMaxTexture2DGatherWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 45 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH = 45) - {"cudaDevAttrMaxTexture2DGatherHeight", {"hipDeviceAttributeMaxTexture2DGatherHeight", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 46 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT = 46) - {"cudaDevAttrMaxTexture3DWidthAlt", {"hipDeviceAttributeMaxTexture3DWidthAlternate", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 47 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE = 47) - {"cudaDevAttrMaxTexture3DHeightAlt", {"hipDeviceAttributeMaxTexture3DHeightAlternate", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 48 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE = 48) - {"cudaDevAttrMaxTexture3DDepthAlt", {"hipDeviceAttributeMaxTexture3DDepthAlternate", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 49 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE = 49) - {"cudaDevAttrPciDomainId", {"hipDeviceAttributePciDomainId", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 50 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID = 50) - {"cudaDevAttrTexturePitchAlignment", {"hipDeviceAttributeTexturePitchAlignment", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 51 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT = 51) - {"cudaDevAttrMaxTextureCubemapWidth", {"hipDeviceAttributeMaxTextureCubemapWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 52 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH = 52) - {"cudaDevAttrMaxTextureCubemapLayeredWidth", {"hipDeviceAttributeMaxTextureCubemapLayeredWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 53 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH = 53) - {"cudaDevAttrMaxTextureCubemapLayeredLayers", {"hipDeviceAttributeMaxTextureCubemapLayeredLayers", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 54 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS = 54) - {"cudaDevAttrMaxSurface1DWidth", {"hipDeviceAttributeMaxSurface1DWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 55 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH = 55) - {"cudaDevAttrMaxSurface2DWidth", {"hipDeviceAttributeMaxSurface2DWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 56 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH = 56) - {"cudaDevAttrMaxSurface2DHeight", {"hipDeviceAttributeMaxSurface2DHeight", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 57 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT = 57) - {"cudaDevAttrMaxSurface3DWidth", {"hipDeviceAttributeMaxSurface3DWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 58 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH = 58) - {"cudaDevAttrMaxSurface3DHeight", {"hipDeviceAttributeMaxSurface3DHeight", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 59 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT = 59) - {"cudaDevAttrMaxSurface3DDepth", {"hipDeviceAttributeMaxSurface3DDepth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 60 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH = 60) - {"cudaDevAttrMaxSurface1DLayeredWidth", {"hipDeviceAttributeMaxSurface1DLayeredWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 61 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH = 61) - {"cudaDevAttrMaxSurface1DLayeredLayers", {"hipDeviceAttributeMaxSurface1DLayeredLayers", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 62 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS = 62) - {"cudaDevAttrMaxSurface2DLayeredWidth", {"hipDeviceAttributeMaxSurface2DLayeredWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 63 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH = 63) - {"cudaDevAttrMaxSurface2DLayeredHeight", {"hipDeviceAttributeMaxSurface2DLayeredHeight", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 64 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT = 64) - {"cudaDevAttrMaxSurface2DLayeredLayers", {"hipDeviceAttributeMaxSurface2DLayeredLayers", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 65 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS = 65) - {"cudaDevAttrMaxSurfaceCubemapWidth", {"hipDeviceAttributeMaxSurfaceCubemapWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 66 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH = 66) - {"cudaDevAttrMaxSurfaceCubemapLayeredWidth", {"hipDeviceAttributeMaxSurfaceCubemapLayeredWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 67 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH = 67) - {"cudaDevAttrMaxSurfaceCubemapLayeredLayers", {"hipDeviceAttributeMaxSurfaceCubemapLayeredLayers", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 68 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS = 68) - {"cudaDevAttrMaxTexture1DLinearWidth", {"hipDeviceAttributeMaxTexture1DLinearWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 69 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH = 69) - {"cudaDevAttrMaxTexture2DLinearWidth", {"hipDeviceAttributeMaxTexture2DLinearWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 70 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH = 70) - {"cudaDevAttrMaxTexture2DLinearHeight", {"hipDeviceAttributeMaxTexture2DLinearHeight", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 71 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT = 71) - {"cudaDevAttrMaxTexture2DLinearPitch", {"hipDeviceAttributeMaxTexture2DLinearPitch", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 72 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH = 72) - {"cudaDevAttrMaxTexture2DMipmappedWidth", {"hipDeviceAttributeMaxTexture2DMipmappedWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 73 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH = 73) - {"cudaDevAttrMaxTexture2DMipmappedHeight", {"hipDeviceAttributeMaxTexture2DMipmappedHeight", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 74 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT = 74) - {"cudaDevAttrComputeCapabilityMajor", {"hipDeviceAttributeComputeCapabilityMajor", CONV_TYPE, API_RUNTIME}}, // 75 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = 75) - {"cudaDevAttrComputeCapabilityMinor", {"hipDeviceAttributeComputeCapabilityMinor", CONV_TYPE, API_RUNTIME}}, // 76 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = 76) - {"cudaDevAttrMaxTexture1DMipmappedWidth", {"hipDeviceAttributeMaxTexture1DMipmappedWidth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 77 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH = 77) - {"cudaDevAttrStreamPrioritiesSupported", {"hipDeviceAttributeStreamPrioritiesSupported", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 78 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED = 78) - {"cudaDevAttrGlobalL1CacheSupported", {"hipDeviceAttributeGlobalL1CacheSupported", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 79 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED = 79) - {"cudaDevAttrLocalL1CacheSupported", {"hipDeviceAttributeLocalL1CacheSupported", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 80 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED = 80) - {"cudaDevAttrMaxSharedMemoryPerMultiprocessor", {"hipDeviceAttributeMaxSharedMemoryPerMultiprocessor", CONV_TYPE, API_RUNTIME}}, // 81 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR = 81) - {"cudaDevAttrMaxRegistersPerMultiprocessor", {"hipDeviceAttributeMaxRegistersPerMultiprocessor", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 82 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR = 82) - {"cudaDevAttrManagedMemory", {"hipDeviceAttributeManagedMemory", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 83 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY = 83) - {"cudaDevAttrIsMultiGpuBoard", {"hipDeviceAttributeIsMultiGpuBoard", CONV_TYPE, API_RUNTIME}}, // 84 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD = 84) - {"cudaDevAttrMultiGpuBoardGroupID", {"hipDeviceAttributeMultiGpuBoardGroupID", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 85 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID = 85) - {"cudaDevAttrHostNativeAtomicSupported", {"hipDeviceAttributeHostNativeAtomicSupported", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 86 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED = 86) - {"cudaDevAttrSingleToDoublePrecisionPerfRatio", {"hipDeviceAttributeSingleToDoublePrecisionPerfRatio", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 87 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO = 87) - {"cudaDevAttrPageableMemoryAccess", {"hipDeviceAttributePageableMemoryAccess", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 88 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS = 88) - {"cudaDevAttrConcurrentManagedAccess", {"hipDeviceAttributeConcurrentManagedAccess", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 89 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS = 89) - {"cudaDevAttrComputePreemptionSupported", {"hipDeviceAttributeComputePreemptionSupported", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 90 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED = 90) - {"cudaDevAttrCanUseHostPointerForRegisteredMem", {"hipDeviceAttributeCanUseHostPointerForRegisteredMem", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 91 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM = 91) + {"cudaDevAttrMaxTexture2DGatherWidth", + {"hipDeviceAttributeMaxTexture2DGatherWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 45 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH = 45) + {"cudaDevAttrMaxTexture2DGatherHeight", + {"hipDeviceAttributeMaxTexture2DGatherHeight", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 46 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT = 46) + {"cudaDevAttrMaxTexture3DWidthAlt", + {"hipDeviceAttributeMaxTexture3DWidthAlternate", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 47 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE = 47) + {"cudaDevAttrMaxTexture3DHeightAlt", + {"hipDeviceAttributeMaxTexture3DHeightAlternate", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 48 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE = 48) + {"cudaDevAttrMaxTexture3DDepthAlt", + {"hipDeviceAttributeMaxTexture3DDepthAlternate", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 49 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE = 49) + {"cudaDevAttrPciDomainId", + {"hipDeviceAttributePciDomainId", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 50 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID = 50) + {"cudaDevAttrTexturePitchAlignment", + {"hipDeviceAttributeTexturePitchAlignment", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 51 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT + // = 51) + {"cudaDevAttrMaxTextureCubemapWidth", + {"hipDeviceAttributeMaxTextureCubemapWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 52 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH = 52) + {"cudaDevAttrMaxTextureCubemapLayeredWidth", + {"hipDeviceAttributeMaxTextureCubemapLayeredWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 53 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH = 53) + {"cudaDevAttrMaxTextureCubemapLayeredLayers", + {"hipDeviceAttributeMaxTextureCubemapLayeredLayers", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 54 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS = 54) + {"cudaDevAttrMaxSurface1DWidth", + {"hipDeviceAttributeMaxSurface1DWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 55 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH + // = 55) + {"cudaDevAttrMaxSurface2DWidth", + {"hipDeviceAttributeMaxSurface2DWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 56 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH + // = 56) + {"cudaDevAttrMaxSurface2DHeight", + {"hipDeviceAttributeMaxSurface2DHeight", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 57 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT + // = 57) + {"cudaDevAttrMaxSurface3DWidth", + {"hipDeviceAttributeMaxSurface3DWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 58 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH + // = 58) + {"cudaDevAttrMaxSurface3DHeight", + {"hipDeviceAttributeMaxSurface3DHeight", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 59 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT + // = 59) + {"cudaDevAttrMaxSurface3DDepth", + {"hipDeviceAttributeMaxSurface3DDepth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 60 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH + // = 60) + {"cudaDevAttrMaxSurface1DLayeredWidth", + {"hipDeviceAttributeMaxSurface1DLayeredWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 61 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH = 61) + {"cudaDevAttrMaxSurface1DLayeredLayers", + {"hipDeviceAttributeMaxSurface1DLayeredLayers", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 62 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS = 62) + {"cudaDevAttrMaxSurface2DLayeredWidth", + {"hipDeviceAttributeMaxSurface2DLayeredWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 63 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH = 63) + {"cudaDevAttrMaxSurface2DLayeredHeight", + {"hipDeviceAttributeMaxSurface2DLayeredHeight", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 64 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT = 64) + {"cudaDevAttrMaxSurface2DLayeredLayers", + {"hipDeviceAttributeMaxSurface2DLayeredLayers", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 65 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS = 65) + {"cudaDevAttrMaxSurfaceCubemapWidth", + {"hipDeviceAttributeMaxSurfaceCubemapWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 66 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH = 66) + {"cudaDevAttrMaxSurfaceCubemapLayeredWidth", + {"hipDeviceAttributeMaxSurfaceCubemapLayeredWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 67 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH = 67) + {"cudaDevAttrMaxSurfaceCubemapLayeredLayers", + {"hipDeviceAttributeMaxSurfaceCubemapLayeredLayers", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 68 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS = 68) + {"cudaDevAttrMaxTexture1DLinearWidth", + {"hipDeviceAttributeMaxTexture1DLinearWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 69 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH = 69) + {"cudaDevAttrMaxTexture2DLinearWidth", + {"hipDeviceAttributeMaxTexture2DLinearWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 70 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH = 70) + {"cudaDevAttrMaxTexture2DLinearHeight", + {"hipDeviceAttributeMaxTexture2DLinearHeight", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 71 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT = 71) + {"cudaDevAttrMaxTexture2DLinearPitch", + {"hipDeviceAttributeMaxTexture2DLinearPitch", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 72 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH = 72) + {"cudaDevAttrMaxTexture2DMipmappedWidth", + {"hipDeviceAttributeMaxTexture2DMipmappedWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 73 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH = 73) + {"cudaDevAttrMaxTexture2DMipmappedHeight", + {"hipDeviceAttributeMaxTexture2DMipmappedHeight", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 74 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT = 74) + {"cudaDevAttrComputeCapabilityMajor", + {"hipDeviceAttributeComputeCapabilityMajor", CONV_TYPE, + API_RUNTIME}}, // 75 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = + // 75) + {"cudaDevAttrComputeCapabilityMinor", + {"hipDeviceAttributeComputeCapabilityMinor", CONV_TYPE, + API_RUNTIME}}, // 76 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = + // 76) + {"cudaDevAttrMaxTexture1DMipmappedWidth", + {"hipDeviceAttributeMaxTexture1DMipmappedWidth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 77 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH = 77) + {"cudaDevAttrStreamPrioritiesSupported", + {"hipDeviceAttributeStreamPrioritiesSupported", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 78 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED = 78) + {"cudaDevAttrGlobalL1CacheSupported", + {"hipDeviceAttributeGlobalL1CacheSupported", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 79 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED = 79) + {"cudaDevAttrLocalL1CacheSupported", + {"hipDeviceAttributeLocalL1CacheSupported", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 80 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED + // = 80) + {"cudaDevAttrMaxSharedMemoryPerMultiprocessor", + {"hipDeviceAttributeMaxSharedMemoryPerMultiprocessor", CONV_TYPE, + API_RUNTIME}}, // 81 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR = 81) + {"cudaDevAttrMaxRegistersPerMultiprocessor", + {"hipDeviceAttributeMaxRegistersPerMultiprocessor", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 82 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR = 82) + {"cudaDevAttrManagedMemory", + {"hipDeviceAttributeManagedMemory", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 83 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY = 83) + {"cudaDevAttrIsMultiGpuBoard", + {"hipDeviceAttributeIsMultiGpuBoard", CONV_TYPE, + API_RUNTIME}}, // 84 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD = 84) + {"cudaDevAttrMultiGpuBoardGroupID", + {"hipDeviceAttributeMultiGpuBoardGroupID", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 85 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID + // = 85) + {"cudaDevAttrHostNativeAtomicSupported", + {"hipDeviceAttributeHostNativeAtomicSupported", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 86 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED = 86) + {"cudaDevAttrSingleToDoublePrecisionPerfRatio", + {"hipDeviceAttributeSingleToDoublePrecisionPerfRatio", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 87 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO = 87) + {"cudaDevAttrPageableMemoryAccess", + {"hipDeviceAttributePageableMemoryAccess", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 88 // API_DRIVER ANALOGUE (CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS = + // 88) + {"cudaDevAttrConcurrentManagedAccess", + {"hipDeviceAttributeConcurrentManagedAccess", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 89 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS = 89) + {"cudaDevAttrComputePreemptionSupported", + {"hipDeviceAttributeComputePreemptionSupported", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 90 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED = 90) + {"cudaDevAttrCanUseHostPointerForRegisteredMem", + {"hipDeviceAttributeCanUseHostPointerForRegisteredMem", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 91 // API_DRIVER ANALOGUE + // (CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM = 91) // Pointer Attributes // struct cudaPointerAttributes - {"cudaPointerGetAttributes", {"hipPointerGetAttributes", CONV_MEM, API_RUNTIME}}, + {"cudaPointerGetAttributes", {"hipPointerGetAttributes", CONV_MEM, API_RUNTIME}}, - {"cudaHostGetDevicePointer", {"hipHostGetDevicePointer", CONV_MEM, API_RUNTIME}}, + {"cudaHostGetDevicePointer", {"hipHostGetDevicePointer", CONV_MEM, API_RUNTIME}}, // Device - {"cudaGetDeviceProperties", {"hipGetDeviceProperties", CONV_DEVICE, API_RUNTIME}}, - {"cudaDeviceGetPCIBusId", {"hipDeviceGetPCIBusId", CONV_DEVICE, API_RUNTIME}}, - {"cudaDeviceGetByPCIBusId", {"hipDeviceGetByPCIBusId", CONV_DEVICE, API_RUNTIME}}, - {"cudaDeviceGetStreamPriorityRange", {"hipDeviceGetStreamPriorityRange", CONV_DEVICE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaSetValidDevices", {"hipSetValidDevices", CONV_DEVICE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGetDeviceProperties", {"hipGetDeviceProperties", CONV_DEVICE, API_RUNTIME}}, + {"cudaDeviceGetPCIBusId", {"hipDeviceGetPCIBusId", CONV_DEVICE, API_RUNTIME}}, + {"cudaDeviceGetByPCIBusId", {"hipDeviceGetByPCIBusId", CONV_DEVICE, API_RUNTIME}}, + {"cudaDeviceGetStreamPriorityRange", + {"hipDeviceGetStreamPriorityRange", CONV_DEVICE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaSetValidDevices", {"hipSetValidDevices", CONV_DEVICE, API_RUNTIME, HIP_UNSUPPORTED}}, // P2P Attributes (enum cudaDeviceP2PAttr) - {"cudaDevP2PAttrPerformanceRank", {"hipDeviceP2PAttributePerformanceRank", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x01 // API_DRIVER ANALOGUE (CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK = 0x01) - {"cudaDevP2PAttrAccessSupported", {"hipDeviceP2PAttributeAccessSupported", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x02 // API_DRIVER ANALOGUE (CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = 0x02) - {"cudaDevP2PAttrNativeAtomicSupported", {"hipDeviceP2PAttributeNativeAtomicSupported", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x03 // API_DRIVER ANALOGUE (CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED = 0x03) + {"cudaDevP2PAttrPerformanceRank", + {"hipDeviceP2PAttributePerformanceRank", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x01 // API_DRIVER ANALOGUE (CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK = + // 0x01) + {"cudaDevP2PAttrAccessSupported", + {"hipDeviceP2PAttributeAccessSupported", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x02 // API_DRIVER ANALOGUE (CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = + // 0x02) + {"cudaDevP2PAttrNativeAtomicSupported", + {"hipDeviceP2PAttributeNativeAtomicSupported", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x03 // API_DRIVER ANALOGUE + // (CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED = 0x03) // - {"cudaDeviceGetP2PAttribute", {"hipDeviceGetP2PAttribute", CONV_DEVICE, API_RUNTIME, HIP_UNSUPPORTED}}, // API_DRIVER ANALOGUE (cuDeviceGetP2PAttribute) + {"cudaDeviceGetP2PAttribute", + {"hipDeviceGetP2PAttribute", CONV_DEVICE, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_DRIVER ANALOGUE (cuDeviceGetP2PAttribute) // enum cudaComputeMode - {"cudaComputeModeDefault", {"hipComputeModeDefault", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0 // API_DRIVER ANALOGUE (CU_COMPUTEMODE_DEFAULT = 0) - {"cudaComputeModeExclusive", {"hipComputeModeExclusive", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 // API_DRIVER ANALOGUE (CU_COMPUTEMODE_EXCLUSIVE = 1) - {"cudaComputeModeProhibited", {"hipComputeModeProhibited", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 2 // API_DRIVER ANALOGUE (CU_COMPUTEMODE_PROHIBITED = 2) - {"cudaComputeModeExclusiveProcess", {"hipComputeModeExclusiveProcess", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 3 // API_DRIVER ANALOGUE (CU_COMPUTEMODE_EXCLUSIVE_PROCESS = 3) + {"cudaComputeModeDefault", + {"hipComputeModeDefault", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0 // API_DRIVER ANALOGUE (CU_COMPUTEMODE_DEFAULT = 0) + {"cudaComputeModeExclusive", + {"hipComputeModeExclusive", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 1 // API_DRIVER ANALOGUE (CU_COMPUTEMODE_EXCLUSIVE = 1) + {"cudaComputeModeProhibited", + {"hipComputeModeProhibited", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 2 // API_DRIVER ANALOGUE (CU_COMPUTEMODE_PROHIBITED = 2) + {"cudaComputeModeExclusiveProcess", + {"hipComputeModeExclusiveProcess", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 3 // API_DRIVER ANALOGUE (CU_COMPUTEMODE_EXCLUSIVE_PROCESS = 3) // Device Flags {"cudaGetDeviceFlags", {"hipGetDeviceFlags", CONV_DEVICE, API_RUNTIME, HIP_UNSUPPORTED}}, {"cudaSetDeviceFlags", {"hipSetDeviceFlags", CONV_DEVICE, API_RUNTIME}}, // Device stuff (#defines) - {"cudaDeviceScheduleAuto", {"hipDeviceScheduleAuto", CONV_TYPE, API_RUNTIME}}, - {"cudaDeviceScheduleSpin", {"hipDeviceScheduleSpin", CONV_TYPE, API_RUNTIME}}, - {"cudaDeviceScheduleYield", {"hipDeviceScheduleYield", CONV_TYPE, API_RUNTIME}}, + {"cudaDeviceScheduleAuto", {"hipDeviceScheduleAuto", CONV_TYPE, API_RUNTIME}}, + {"cudaDeviceScheduleSpin", {"hipDeviceScheduleSpin", CONV_TYPE, API_RUNTIME}}, + {"cudaDeviceScheduleYield", {"hipDeviceScheduleYield", CONV_TYPE, API_RUNTIME}}, // deprecated as of CUDA 4.0 and replaced with cudaDeviceScheduleBlockingSync - {"cudaDeviceBlockingSync", {"hipDeviceScheduleBlockingSync", CONV_TYPE, API_RUNTIME}}, + {"cudaDeviceBlockingSync", {"hipDeviceScheduleBlockingSync", CONV_TYPE, API_RUNTIME}}, {"cudaDeviceScheduleBlockingSync", {"hipDeviceScheduleBlockingSync", CONV_TYPE, API_RUNTIME}}, - {"cudaDeviceScheduleMask", {"hipDeviceScheduleMask", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaDeviceMapHost", {"hipDeviceMapHost", CONV_TYPE, API_RUNTIME}}, - {"cudaDeviceLmemResizeToMax", {"hipDeviceLmemResizeToMax", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaDeviceMask", {"hipDeviceMask", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaDeviceScheduleMask", {"hipDeviceScheduleMask", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaDeviceMapHost", {"hipDeviceMapHost", CONV_TYPE, API_RUNTIME}}, + {"cudaDeviceLmemResizeToMax", + {"hipDeviceLmemResizeToMax", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaDeviceMask", {"hipDeviceMask", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // Cache config {"cudaDeviceSetCacheConfig", {"hipDeviceSetCacheConfig", CONV_CACHE, API_RUNTIME}}, {"cudaDeviceGetCacheConfig", {"hipDeviceGetCacheConfig", CONV_CACHE, API_RUNTIME}}, - {"cudaFuncSetCacheConfig", {"hipFuncSetCacheConfig", CONV_CACHE, API_RUNTIME}}, + {"cudaFuncSetCacheConfig", {"hipFuncSetCacheConfig", CONV_CACHE, API_RUNTIME}}, // Execution control // CUDA function cache configurations (enum cudaFuncCache) - {"cudaFuncCachePreferNone", {"hipFuncCachePreferNone", CONV_CACHE, API_RUNTIME}}, // 0 // API_Driver ANALOGUE (CU_FUNC_CACHE_PREFER_NONE = 0x00) - {"cudaFuncCachePreferShared", {"hipFuncCachePreferShared", CONV_CACHE, API_RUNTIME}}, // 1 // API_Driver ANALOGUE (CU_FUNC_CACHE_PREFER_SHARED = 0x01) - {"cudaFuncCachePreferL1", {"hipFuncCachePreferL1", CONV_CACHE, API_RUNTIME}}, // 2 // API_Driver ANALOGUE (CU_FUNC_CACHE_PREFER_L1 = 0x02) - {"cudaFuncCachePreferEqual", {"hipFuncCachePreferEqual", CONV_CACHE, API_RUNTIME}}, // 3 // API_Driver ANALOGUE (CU_FUNC_CACHE_PREFER_EQUAL = 0x03) + {"cudaFuncCachePreferNone", + {"hipFuncCachePreferNone", CONV_CACHE, + API_RUNTIME}}, // 0 // API_Driver ANALOGUE (CU_FUNC_CACHE_PREFER_NONE = 0x00) + {"cudaFuncCachePreferShared", + {"hipFuncCachePreferShared", CONV_CACHE, + API_RUNTIME}}, // 1 // API_Driver ANALOGUE (CU_FUNC_CACHE_PREFER_SHARED = 0x01) + {"cudaFuncCachePreferL1", + {"hipFuncCachePreferL1", CONV_CACHE, + API_RUNTIME}}, // 2 // API_Driver ANALOGUE (CU_FUNC_CACHE_PREFER_L1 = 0x02) + {"cudaFuncCachePreferEqual", + {"hipFuncCachePreferEqual", CONV_CACHE, + API_RUNTIME}}, // 3 // API_Driver ANALOGUE (CU_FUNC_CACHE_PREFER_EQUAL = 0x03) // Execution control functions - {"cudaFuncGetAttributes", {"hipFuncGetAttributes", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaFuncSetSharedMemConfig", {"hipFuncSetSharedMemConfig", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGetParameterBuffer", {"hipGetParameterBuffer", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaSetDoubleForDevice", {"hipSetDoubleForDevice", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaSetDoubleForHost", {"hipSetDoubleForHost", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaFuncGetAttributes", {"hipFuncGetAttributes", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaFuncSetSharedMemConfig", + {"hipFuncSetSharedMemConfig", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGetParameterBuffer", {"hipGetParameterBuffer", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaSetDoubleForDevice", {"hipSetDoubleForDevice", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaSetDoubleForHost", {"hipSetDoubleForHost", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, // Execution Control [deprecated since 7.0] {"cudaConfigureCall", {"hipConfigureCall", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaLaunch", {"hipLaunch", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaLaunch", {"hipLaunch", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, {"cudaSetupArgument", {"hipSetupArgument", CONV_EXEC, API_RUNTIME, HIP_UNSUPPORTED}}, // Version Management - {"cudaDriverGetVersion", {"hipDriverGetVersion", CONV_VERSION, API_RUNTIME}}, + {"cudaDriverGetVersion", {"hipDriverGetVersion", CONV_VERSION, API_RUNTIME}}, {"cudaRuntimeGetVersion", {"hipRuntimeGetVersion", CONV_VERSION, API_RUNTIME, HIP_UNSUPPORTED}}, // Occupancy - {"cudaOccupancyMaxPotentialBlockSize", {"hipOccupancyMaxPotentialBlockSize", CONV_OCCUPANCY, API_RUNTIME}}, - {"cudaOccupancyMaxPotentialBlockSizeWithFlags", {"hipOccupancyMaxPotentialBlockSizeWithFlags", CONV_OCCUPANCY, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaOccupancyMaxActiveBlocksPerMultiprocessor", {"hipOccupancyMaxActiveBlocksPerMultiprocessor", CONV_OCCUPANCY, API_RUNTIME}}, - {"cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", {"hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", CONV_OCCUPANCY, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaOccupancyMaxPotentialBlockSizeVariableSMem", {"hipOccupancyMaxPotentialBlockSizeVariableSMem", CONV_OCCUPANCY, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags", {"hipOccupancyMaxPotentialBlockSizeVariableSMemWithFlags", CONV_OCCUPANCY, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaOccupancyMaxPotentialBlockSize", + {"hipOccupancyMaxPotentialBlockSize", CONV_OCCUPANCY, API_RUNTIME}}, + {"cudaOccupancyMaxPotentialBlockSizeWithFlags", + {"hipOccupancyMaxPotentialBlockSizeWithFlags", CONV_OCCUPANCY, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaOccupancyMaxActiveBlocksPerMultiprocessor", + {"hipOccupancyMaxActiveBlocksPerMultiprocessor", CONV_OCCUPANCY, API_RUNTIME}}, + {"cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", + {"hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", CONV_OCCUPANCY, API_RUNTIME, + HIP_UNSUPPORTED}}, + {"cudaOccupancyMaxPotentialBlockSizeVariableSMem", + {"hipOccupancyMaxPotentialBlockSizeVariableSMem", CONV_OCCUPANCY, API_RUNTIME, + HIP_UNSUPPORTED}}, + {"cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags", + {"hipOccupancyMaxPotentialBlockSizeVariableSMemWithFlags", CONV_OCCUPANCY, API_RUNTIME, + HIP_UNSUPPORTED}}, // Peer2Peer - {"cudaDeviceCanAccessPeer", {"hipDeviceCanAccessPeer", CONV_PEER, API_RUNTIME}}, + {"cudaDeviceCanAccessPeer", {"hipDeviceCanAccessPeer", CONV_PEER, API_RUNTIME}}, {"cudaDeviceDisablePeerAccess", {"hipDeviceDisablePeerAccess", CONV_PEER, API_RUNTIME}}, - {"cudaDeviceEnablePeerAccess", {"hipDeviceEnablePeerAccess", CONV_PEER, API_RUNTIME}}, + {"cudaDeviceEnablePeerAccess", {"hipDeviceEnablePeerAccess", CONV_PEER, API_RUNTIME}}, - {"cudaMemcpyPeerAsync", {"hipMemcpyPeerAsync", CONV_MEM, API_RUNTIME}}, - {"cudaMemcpyPeer", {"hipMemcpyPeer", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpyPeerAsync", {"hipMemcpyPeerAsync", CONV_MEM, API_RUNTIME}}, + {"cudaMemcpyPeer", {"hipMemcpyPeer", CONV_MEM, API_RUNTIME}}, // #define cudaIpcMemLazyEnablePeerAccess 0x01 - {"cudaIpcMemLazyEnablePeerAccess", {"hipIpcMemLazyEnablePeerAccess", CONV_TYPE, API_RUNTIME}}, // 0x01 // API_Driver ANALOGUE (CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = 0x1) + {"cudaIpcMemLazyEnablePeerAccess", + {"hipIpcMemLazyEnablePeerAccess", CONV_TYPE, + API_RUNTIME}}, // 0x01 // API_Driver ANALOGUE (CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = 0x1) // Shared memory - {"cudaDeviceSetSharedMemConfig", {"hipDeviceSetSharedMemConfig", CONV_DEVICE, API_RUNTIME}}, - {"cudaDeviceGetSharedMemConfig", {"hipDeviceGetSharedMemConfig", CONV_DEVICE, API_RUNTIME}}, + {"cudaDeviceSetSharedMemConfig", {"hipDeviceSetSharedMemConfig", CONV_DEVICE, API_RUNTIME}}, + {"cudaDeviceGetSharedMemConfig", {"hipDeviceGetSharedMemConfig", CONV_DEVICE, API_RUNTIME}}, // translate deprecated - // {"cudaThreadGetSharedMemConfig", {"hipDeviceGetSharedMemConfig", CONV_DEVICE, API_RUNTIME}}, - // {"cudaThreadSetSharedMemConfig", {"hipDeviceSetSharedMemConfig", CONV_DEVICE, API_RUNTIME}}, + // {"cudaThreadGetSharedMemConfig", {"hipDeviceGetSharedMemConfig", CONV_DEVICE, + // API_RUNTIME}}, + // {"cudaThreadSetSharedMemConfig", {"hipDeviceSetSharedMemConfig", CONV_DEVICE, + // API_RUNTIME}}, // enum cudaSharedMemConfig - {"cudaSharedMemBankSizeDefault", {"hipSharedMemBankSizeDefault", CONV_TYPE, API_RUNTIME}}, - {"cudaSharedMemBankSizeFourByte", {"hipSharedMemBankSizeFourByte", CONV_TYPE, API_RUNTIME}}, + {"cudaSharedMemBankSizeDefault", {"hipSharedMemBankSizeDefault", CONV_TYPE, API_RUNTIME}}, + {"cudaSharedMemBankSizeFourByte", {"hipSharedMemBankSizeFourByte", CONV_TYPE, API_RUNTIME}}, {"cudaSharedMemBankSizeEightByte", {"hipSharedMemBankSizeEightByte", CONV_TYPE, API_RUNTIME}}, // enum cudaLimit - {"cudaLimitStackSize", {"hipLimitStackSize", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x00 // API_Driver ANALOGUE (CU_LIMIT_STACK_SIZE = 0x00) - {"cudaLimitPrintfFifoSize", {"hipLimitPrintfFifoSize", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x01 // API_Driver ANALOGUE (CU_LIMIT_PRINTF_FIFO_SIZE = 0x01) - {"cudaLimitMallocHeapSize", {"hipLimitMallocHeapSize", CONV_TYPE, API_RUNTIME}}, // 0x02 // API_Driver ANALOGUE (CU_LIMIT_MALLOC_HEAP_SIZE = 0x02) - {"cudaLimitDevRuntimeSyncDepth", {"hipLimitDevRuntimeSyncDepth", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x03 // API_Driver ANALOGUE (CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = 0x03) - {"cudaLimitDevRuntimePendingLaunchCount", {"hipLimitDevRuntimePendingLaunchCount", CONV_TYPE, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x04 // API_Driver ANALOGUE (CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = 0x04) + {"cudaLimitStackSize", + {"hipLimitStackSize", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x00 // API_Driver ANALOGUE (CU_LIMIT_STACK_SIZE = 0x00) + {"cudaLimitPrintfFifoSize", + {"hipLimitPrintfFifoSize", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x01 // API_Driver ANALOGUE (CU_LIMIT_PRINTF_FIFO_SIZE = 0x01) + {"cudaLimitMallocHeapSize", + {"hipLimitMallocHeapSize", CONV_TYPE, + API_RUNTIME}}, // 0x02 // API_Driver ANALOGUE (CU_LIMIT_MALLOC_HEAP_SIZE = 0x02) + {"cudaLimitDevRuntimeSyncDepth", + {"hipLimitDevRuntimeSyncDepth", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x03 // API_Driver ANALOGUE (CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = 0x03) + {"cudaLimitDevRuntimePendingLaunchCount", + {"hipLimitDevRuntimePendingLaunchCount", CONV_TYPE, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x04 // API_Driver ANALOGUE (CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT + // = 0x04) - {"cudaDeviceGetLimit", {"hipDeviceGetLimit", CONV_DEVICE, API_RUNTIME}}, + {"cudaDeviceGetLimit", {"hipDeviceGetLimit", CONV_DEVICE, API_RUNTIME}}, // Profiler - {"cudaProfilerInitialize", {"hipProfilerInitialize", CONV_OTHER, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuProfilerInitialize) - {"cudaProfilerStart", {"hipProfilerStart", CONV_OTHER, API_RUNTIME}}, // API_Driver ANALOGUE (cuProfilerStart) - {"cudaProfilerStop", {"hipProfilerStop", CONV_OTHER, API_RUNTIME}}, // API_Driver ANALOGUE (cuProfilerStop) + {"cudaProfilerInitialize", + {"hipProfilerInitialize", CONV_OTHER, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuProfilerInitialize) + {"cudaProfilerStart", + {"hipProfilerStart", CONV_OTHER, API_RUNTIME}}, // API_Driver ANALOGUE (cuProfilerStart) + {"cudaProfilerStop", + {"hipProfilerStop", CONV_OTHER, API_RUNTIME}}, // API_Driver ANALOGUE (cuProfilerStop) // enum cudaOutputMode {"cudaKeyValuePair", {"hipKeyValuePair", CONV_OTHER, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaCSV", {"hipCSV", CONV_OTHER, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaCSV", {"hipCSV", CONV_OTHER, API_RUNTIME, HIP_UNSUPPORTED}}, // Texture Reference Management // enum cudaTextureReadMode - {"cudaReadModeElementType", {"hipReadModeElementType", CONV_TEX, API_RUNTIME}}, - {"cudaReadModeNormalizedFloat", {"hipReadModeNormalizedFloat", CONV_TEX, API_RUNTIME}}, + {"cudaReadModeElementType", {"hipReadModeElementType", CONV_TEX, API_RUNTIME}}, + {"cudaReadModeNormalizedFloat", {"hipReadModeNormalizedFloat", CONV_TEX, API_RUNTIME}}, // enum cudaTextureFilterMode - {"cudaFilterModePoint", {"hipFilterModePoint", CONV_TEX, API_RUNTIME}}, // 0 // API_DRIVER ANALOGUE (CU_TR_FILTER_MODE_POINT = 0) - {"cudaFilterModeLinear", {"hipFilterModeLinear", CONV_TEX, API_RUNTIME}}, // 1 // API_DRIVER ANALOGUE (CU_TR_FILTER_MODE_POINT = 1) + {"cudaFilterModePoint", + {"hipFilterModePoint", CONV_TEX, + API_RUNTIME}}, // 0 // API_DRIVER ANALOGUE (CU_TR_FILTER_MODE_POINT = 0) + {"cudaFilterModeLinear", + {"hipFilterModeLinear", CONV_TEX, + API_RUNTIME}}, // 1 // API_DRIVER ANALOGUE (CU_TR_FILTER_MODE_POINT = 1) - {"cudaBindTexture", {"hipBindTexture", CONV_TEX, API_RUNTIME}}, - {"cudaUnbindTexture", {"hipUnbindTexture", CONV_TEX, API_RUNTIME}}, - {"cudaBindTexture2D", {"hipBindTexture2D", CONV_TEX, API_RUNTIME}}, - {"cudaBindTextureToArray", {"hipBindTextureToArray", CONV_TEX, API_RUNTIME}}, - {"cudaBindTextureToMipmappedArray", {"hipBindTextureToMipmappedArray", CONV_TEX, API_RUNTIME}}, // Unsupported yet on NVCC path - {"cudaGetTextureAlignmentOffset", {"hipGetTextureAlignmentOffset", CONV_TEX, API_RUNTIME}}, // Unsupported yet on NVCC path - {"cudaGetTextureReference", {"hipGetTextureReference", CONV_TEX, API_RUNTIME}}, // Unsupported yet on NVCC path + {"cudaBindTexture", {"hipBindTexture", CONV_TEX, API_RUNTIME}}, + {"cudaUnbindTexture", {"hipUnbindTexture", CONV_TEX, API_RUNTIME}}, + {"cudaBindTexture2D", {"hipBindTexture2D", CONV_TEX, API_RUNTIME}}, + {"cudaBindTextureToArray", {"hipBindTextureToArray", CONV_TEX, API_RUNTIME}}, + {"cudaBindTextureToMipmappedArray", + {"hipBindTextureToMipmappedArray", CONV_TEX, API_RUNTIME}}, // Unsupported yet on NVCC path + {"cudaGetTextureAlignmentOffset", + {"hipGetTextureAlignmentOffset", CONV_TEX, API_RUNTIME}}, // Unsupported yet on NVCC path + {"cudaGetTextureReference", + {"hipGetTextureReference", CONV_TEX, API_RUNTIME}}, // Unsupported yet on NVCC path // Channel (enum cudaChannelFormatKind) - {"cudaChannelFormatKindSigned", {"hipChannelFormatKindSigned", CONV_TEX, API_RUNTIME}}, + {"cudaChannelFormatKindSigned", {"hipChannelFormatKindSigned", CONV_TEX, API_RUNTIME}}, {"cudaChannelFormatKindUnsigned", {"hipChannelFormatKindUnsigned", CONV_TEX, API_RUNTIME}}, - {"cudaChannelFormatKindFloat", {"hipChannelFormatKindFloat", CONV_TEX, API_RUNTIME}}, - {"cudaChannelFormatKindNone", {"hipChannelFormatKindNone", CONV_TEX, API_RUNTIME}}, + {"cudaChannelFormatKindFloat", {"hipChannelFormatKindFloat", CONV_TEX, API_RUNTIME}}, + {"cudaChannelFormatKindNone", {"hipChannelFormatKindNone", CONV_TEX, API_RUNTIME}}, - {"cudaCreateChannelDesc", {"hipCreateChannelDesc", CONV_TEX, API_RUNTIME}}, - {"cudaGetChannelDesc", {"hipGetChannelDesc", CONV_TEX, API_RUNTIME}}, + {"cudaCreateChannelDesc", {"hipCreateChannelDesc", CONV_TEX, API_RUNTIME}}, + {"cudaGetChannelDesc", {"hipGetChannelDesc", CONV_TEX, API_RUNTIME}}, // Texture Object Management // enum cudaResourceType - {"cudaResourceTypeArray", {"hipResourceTypeArray", CONV_TEX, API_RUNTIME}}, // 0x00 // API_Driver ANALOGUE (CU_RESOURCE_TYPE_ARRAY = 0x00) - {"cudaResourceTypeMipmappedArray", {"hipResourceTypeMipmappedArray", CONV_TEX, API_RUNTIME}}, // 0x01 // API_Driver ANALOGUE (CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01) - {"cudaResourceTypeLinear", {"hipResourceTypeLinear", CONV_TEX, API_RUNTIME}}, // 0x02 // API_Driver ANALOGUE (CU_RESOURCE_TYPE_LINEAR = 0x02) - {"cudaResourceTypePitch2D", {"hipResourceTypePitch2D", CONV_TEX, API_RUNTIME}}, // 0x03 // API_Driver ANALOGUE (CU_RESOURCE_TYPE_PITCH2D = 0x03) + {"cudaResourceTypeArray", + {"hipResourceTypeArray", CONV_TEX, + API_RUNTIME}}, // 0x00 // API_Driver ANALOGUE (CU_RESOURCE_TYPE_ARRAY = 0x00) + {"cudaResourceTypeMipmappedArray", + {"hipResourceTypeMipmappedArray", CONV_TEX, + API_RUNTIME}}, // 0x01 // API_Driver ANALOGUE (CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01) + {"cudaResourceTypeLinear", + {"hipResourceTypeLinear", CONV_TEX, + API_RUNTIME}}, // 0x02 // API_Driver ANALOGUE (CU_RESOURCE_TYPE_LINEAR = 0x02) + {"cudaResourceTypePitch2D", + {"hipResourceTypePitch2D", CONV_TEX, + API_RUNTIME}}, // 0x03 // API_Driver ANALOGUE (CU_RESOURCE_TYPE_PITCH2D = 0x03) // enum cudaResourceViewFormat - {"cudaResViewFormatNone", {"hipResViewFormatNone", CONV_TEX, API_RUNTIME}}, // 0x00 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_NONE = 0x00) - {"cudaResViewFormatUnsignedChar1", {"hipResViewFormatUnsignedChar1", CONV_TEX, API_RUNTIME}}, // 0x01 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_1X8 = 0x01) - {"cudaResViewFormatUnsignedChar2", {"hipResViewFormatUnsignedChar2", CONV_TEX, API_RUNTIME}}, // 0x02 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_2X8 = 0x02) - {"cudaResViewFormatUnsignedChar4", {"hipResViewFormatUnsignedChar4", CONV_TEX, API_RUNTIME}}, // 0x03 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_4X8 = 0x03) - {"cudaResViewFormatSignedChar1", {"hipResViewFormatSignedChar1", CONV_TEX, API_RUNTIME}}, // 0x04 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_1X8 = 0x04) - {"cudaResViewFormatSignedChar2", {"hipResViewFormatSignedChar2", CONV_TEX, API_RUNTIME}}, // 0x05 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_2X8 = 0x05) - {"cudaResViewFormatSignedChar4", {"hipResViewFormatSignedChar4", CONV_TEX, API_RUNTIME}}, // 0x06 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_4X8 = 0x06) - {"cudaResViewFormatUnsignedShort1", {"hipResViewFormatUnsignedShort1", CONV_TEX, API_RUNTIME}}, // 0x07 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_1X16 = 0x07) - {"cudaResViewFormatUnsignedShort2", {"hipResViewFormatUnsignedShort2", CONV_TEX, API_RUNTIME}}, // 0x08 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_2X16 = 0x08) - {"cudaResViewFormatUnsignedShort4", {"hipResViewFormatUnsignedShort4", CONV_TEX, API_RUNTIME}}, // 0x09 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_4X16 = 0x09) - {"cudaResViewFormatSignedShort1", {"hipResViewFormatSignedShort1", CONV_TEX, API_RUNTIME}}, // 0x0a // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_1X16 = 0x0a) - {"cudaResViewFormatSignedShort2", {"hipResViewFormatSignedShort2", CONV_TEX, API_RUNTIME}}, // 0x0b // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_2X16 = 0x0b) - {"cudaResViewFormatSignedShort4", {"hipResViewFormatSignedShort4", CONV_TEX, API_RUNTIME}}, // 0x0c // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_4X16 = 0x0c) - {"cudaResViewFormatUnsignedInt1", {"hipResViewFormatUnsignedInt1", CONV_TEX, API_RUNTIME}}, // 0x0d // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_1X32 = 0x0d) - {"cudaResViewFormatUnsignedInt2", {"hipResViewFormatUnsignedInt2", CONV_TEX, API_RUNTIME}}, // 0x0e // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_2X32 = 0x0e) - {"cudaResViewFormatUnsignedInt4", {"hipResViewFormatUnsignedInt4", CONV_TEX, API_RUNTIME}}, // 0x0f // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_4X32 = 0x0f) - {"cudaResViewFormatSignedInt1", {"hipResViewFormatSignedInt1", CONV_TEX, API_RUNTIME}}, // 0x10 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_1X32 = 0x10) - {"cudaResViewFormatSignedInt2", {"hipResViewFormatSignedInt2", CONV_TEX, API_RUNTIME}}, // 0x11 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_2X32 = 0x11) - {"cudaResViewFormatSignedInt4", {"hipResViewFormatSignedInt4", CONV_TEX, API_RUNTIME}}, // 0x12 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_4X32 = 0x12) - {"cudaResViewFormatHalf1", {"hipResViewFormatHalf1", CONV_TEX, API_RUNTIME}}, // 0x13 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_FLOAT_1X16 = 0x13) - {"cudaResViewFormatHalf2", {"hipResViewFormatHalf2", CONV_TEX, API_RUNTIME}}, // 0x14 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_FLOAT_2X16 = 0x14) - {"cudaResViewFormatHalf4", {"hipResViewFormatHalf4", CONV_TEX, API_RUNTIME}}, // 0x15 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_FLOAT_4X16 = 0x15) - {"cudaResViewFormatFloat1", {"hipResViewFormatFloat1", CONV_TEX, API_RUNTIME}}, // 0x16 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_FLOAT_1X32 = 0x16) - {"cudaResViewFormatFloat2", {"hipResViewFormatFloat2", CONV_TEX, API_RUNTIME}}, // 0x17 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_FLOAT_2X32 = 0x17) - {"cudaResViewFormatFloat4", {"hipResViewFormatFloat4", CONV_TEX, API_RUNTIME}}, // 0x18 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_FLOAT_4X32 = 0x18) - {"cudaResViewFormatUnsignedBlockCompressed1", {"hipResViewFormatUnsignedBlockCompressed1", CONV_TEX, API_RUNTIME}}, // 0x19 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC1 = 0x19) - {"cudaResViewFormatUnsignedBlockCompressed2", {"hipResViewFormatUnsignedBlockCompressed2", CONV_TEX, API_RUNTIME}}, // 0x1a // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC2 = 0x1a) - {"cudaResViewFormatUnsignedBlockCompressed3", {"hipResViewFormatUnsignedBlockCompressed3", CONV_TEX, API_RUNTIME}}, // 0x1b // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC3 = 0x1b) - {"cudaResViewFormatUnsignedBlockCompressed4", {"hipResViewFormatUnsignedBlockCompressed4", CONV_TEX, API_RUNTIME}}, // 0x1c // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC4 = 0x1c) - {"cudaResViewFormatSignedBlockCompressed4", {"hipResViewFormatSignedBlockCompressed4", CONV_TEX, API_RUNTIME}}, // 0x1d // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SIGNED_BC4 = 0x1d) - {"cudaResViewFormatUnsignedBlockCompressed5", {"hipResViewFormatUnsignedBlockCompressed5", CONV_TEX, API_RUNTIME}}, // 0x1e // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC5 = 0x1e) - {"cudaResViewFormatSignedBlockCompressed5", {"hipResViewFormatSignedBlockCompressed5", CONV_TEX, API_RUNTIME}}, // 0x1f // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SIGNED_BC5 = 0x1f) - {"cudaResViewFormatUnsignedBlockCompressed6H", {"hipResViewFormatUnsignedBlockCompressed6H", CONV_TEX, API_RUNTIME}}, // 0x20 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC6H = 0x20) - {"cudaResViewFormatSignedBlockCompressed6H", {"hipResViewFormatSignedBlockCompressed6H", CONV_TEX, API_RUNTIME}}, // 0x21 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SIGNED_BC6H = 0x21) - {"cudaResViewFormatUnsignedBlockCompressed7", {"hipResViewFormatUnsignedBlockCompressed7", CONV_TEX, API_RUNTIME}}, // 0x22 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC7 = 0x22) + {"cudaResViewFormatNone", + {"hipResViewFormatNone", CONV_TEX, + API_RUNTIME}}, // 0x00 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_NONE = 0x00) + {"cudaResViewFormatUnsignedChar1", + {"hipResViewFormatUnsignedChar1", CONV_TEX, + API_RUNTIME}}, // 0x01 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_1X8 = 0x01) + {"cudaResViewFormatUnsignedChar2", + {"hipResViewFormatUnsignedChar2", CONV_TEX, + API_RUNTIME}}, // 0x02 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_2X8 = 0x02) + {"cudaResViewFormatUnsignedChar4", + {"hipResViewFormatUnsignedChar4", CONV_TEX, + API_RUNTIME}}, // 0x03 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_4X8 = 0x03) + {"cudaResViewFormatSignedChar1", + {"hipResViewFormatSignedChar1", CONV_TEX, + API_RUNTIME}}, // 0x04 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_1X8 = 0x04) + {"cudaResViewFormatSignedChar2", + {"hipResViewFormatSignedChar2", CONV_TEX, + API_RUNTIME}}, // 0x05 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_2X8 = 0x05) + {"cudaResViewFormatSignedChar4", + {"hipResViewFormatSignedChar4", CONV_TEX, + API_RUNTIME}}, // 0x06 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_4X8 = 0x06) + {"cudaResViewFormatUnsignedShort1", + {"hipResViewFormatUnsignedShort1", CONV_TEX, + API_RUNTIME}}, // 0x07 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_1X16 = 0x07) + {"cudaResViewFormatUnsignedShort2", + {"hipResViewFormatUnsignedShort2", CONV_TEX, + API_RUNTIME}}, // 0x08 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_2X16 = 0x08) + {"cudaResViewFormatUnsignedShort4", + {"hipResViewFormatUnsignedShort4", CONV_TEX, + API_RUNTIME}}, // 0x09 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_4X16 = 0x09) + {"cudaResViewFormatSignedShort1", + {"hipResViewFormatSignedShort1", CONV_TEX, + API_RUNTIME}}, // 0x0a // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_1X16 = 0x0a) + {"cudaResViewFormatSignedShort2", + {"hipResViewFormatSignedShort2", CONV_TEX, + API_RUNTIME}}, // 0x0b // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_2X16 = 0x0b) + {"cudaResViewFormatSignedShort4", + {"hipResViewFormatSignedShort4", CONV_TEX, + API_RUNTIME}}, // 0x0c // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_4X16 = 0x0c) + {"cudaResViewFormatUnsignedInt1", + {"hipResViewFormatUnsignedInt1", CONV_TEX, + API_RUNTIME}}, // 0x0d // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_1X32 = 0x0d) + {"cudaResViewFormatUnsignedInt2", + {"hipResViewFormatUnsignedInt2", CONV_TEX, + API_RUNTIME}}, // 0x0e // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_2X32 = 0x0e) + {"cudaResViewFormatUnsignedInt4", + {"hipResViewFormatUnsignedInt4", CONV_TEX, + API_RUNTIME}}, // 0x0f // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UINT_4X32 = 0x0f) + {"cudaResViewFormatSignedInt1", + {"hipResViewFormatSignedInt1", CONV_TEX, + API_RUNTIME}}, // 0x10 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_1X32 = 0x10) + {"cudaResViewFormatSignedInt2", + {"hipResViewFormatSignedInt2", CONV_TEX, + API_RUNTIME}}, // 0x11 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_2X32 = 0x11) + {"cudaResViewFormatSignedInt4", + {"hipResViewFormatSignedInt4", CONV_TEX, + API_RUNTIME}}, // 0x12 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SINT_4X32 = 0x12) + {"cudaResViewFormatHalf1", + {"hipResViewFormatHalf1", CONV_TEX, + API_RUNTIME}}, // 0x13 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_FLOAT_1X16 = 0x13) + {"cudaResViewFormatHalf2", + {"hipResViewFormatHalf2", CONV_TEX, + API_RUNTIME}}, // 0x14 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_FLOAT_2X16 = 0x14) + {"cudaResViewFormatHalf4", + {"hipResViewFormatHalf4", CONV_TEX, + API_RUNTIME}}, // 0x15 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_FLOAT_4X16 = 0x15) + {"cudaResViewFormatFloat1", + {"hipResViewFormatFloat1", CONV_TEX, + API_RUNTIME}}, // 0x16 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_FLOAT_1X32 = 0x16) + {"cudaResViewFormatFloat2", + {"hipResViewFormatFloat2", CONV_TEX, + API_RUNTIME}}, // 0x17 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_FLOAT_2X32 = 0x17) + {"cudaResViewFormatFloat4", + {"hipResViewFormatFloat4", CONV_TEX, + API_RUNTIME}}, // 0x18 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_FLOAT_4X32 = 0x18) + {"cudaResViewFormatUnsignedBlockCompressed1", + {"hipResViewFormatUnsignedBlockCompressed1", CONV_TEX, + API_RUNTIME}}, // 0x19 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC1 = 0x19) + {"cudaResViewFormatUnsignedBlockCompressed2", + {"hipResViewFormatUnsignedBlockCompressed2", CONV_TEX, + API_RUNTIME}}, // 0x1a // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC2 = 0x1a) + {"cudaResViewFormatUnsignedBlockCompressed3", + {"hipResViewFormatUnsignedBlockCompressed3", CONV_TEX, + API_RUNTIME}}, // 0x1b // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC3 = 0x1b) + {"cudaResViewFormatUnsignedBlockCompressed4", + {"hipResViewFormatUnsignedBlockCompressed4", CONV_TEX, + API_RUNTIME}}, // 0x1c // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC4 = 0x1c) + {"cudaResViewFormatSignedBlockCompressed4", + {"hipResViewFormatSignedBlockCompressed4", CONV_TEX, + API_RUNTIME}}, // 0x1d // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SIGNED_BC4 = 0x1d) + {"cudaResViewFormatUnsignedBlockCompressed5", + {"hipResViewFormatUnsignedBlockCompressed5", CONV_TEX, + API_RUNTIME}}, // 0x1e // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC5 = 0x1e) + {"cudaResViewFormatSignedBlockCompressed5", + {"hipResViewFormatSignedBlockCompressed5", CONV_TEX, + API_RUNTIME}}, // 0x1f // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SIGNED_BC5 = 0x1f) + {"cudaResViewFormatUnsignedBlockCompressed6H", + {"hipResViewFormatUnsignedBlockCompressed6H", CONV_TEX, + API_RUNTIME}}, // 0x20 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC6H = 0x20) + {"cudaResViewFormatSignedBlockCompressed6H", + {"hipResViewFormatSignedBlockCompressed6H", CONV_TEX, + API_RUNTIME}}, // 0x21 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_SIGNED_BC6H = 0x21) + {"cudaResViewFormatUnsignedBlockCompressed7", + {"hipResViewFormatUnsignedBlockCompressed7", CONV_TEX, + API_RUNTIME}}, // 0x22 // API_Driver ANALOGUE (CU_RES_VIEW_FORMAT_UNSIGNED_BC7 = 0x22) - {"cudaAddressModeWrap", {"hipAddressModeWrap", CONV_TEX, API_RUNTIME}}, - {"cudaAddressModeClamp", {"hipAddressModeClamp", CONV_TEX, API_RUNTIME}}, - {"cudaAddressModeMirror", {"hipAddressModeMirror", CONV_TEX, API_RUNTIME}}, - {"cudaAddressModeBorder", {"hipAddressModeBorder", CONV_TEX, API_RUNTIME}}, + {"cudaAddressModeWrap", {"hipAddressModeWrap", CONV_TEX, API_RUNTIME}}, + {"cudaAddressModeClamp", {"hipAddressModeClamp", CONV_TEX, API_RUNTIME}}, + {"cudaAddressModeMirror", {"hipAddressModeMirror", CONV_TEX, API_RUNTIME}}, + {"cudaAddressModeBorder", {"hipAddressModeBorder", CONV_TEX, API_RUNTIME}}, // functions - {"cudaCreateTextureObject", {"hipCreateTextureObject", CONV_TEX, API_RUNTIME}}, - {"cudaDestroyTextureObject", {"hipDestroyTextureObject", CONV_TEX, API_RUNTIME}}, - {"cudaGetTextureObjectResourceDesc", {"hipGetTextureObjectResourceDesc", CONV_TEX, API_RUNTIME}}, - {"cudaGetTextureObjectResourceViewDesc", {"hipGetTextureObjectResourceViewDesc", CONV_TEX, API_RUNTIME}}, - {"cudaGetTextureObjectTextureDesc", {"hipGetTextureObjectTextureDesc", CONV_TEX, API_RUNTIME}}, + {"cudaCreateTextureObject", {"hipCreateTextureObject", CONV_TEX, API_RUNTIME}}, + {"cudaDestroyTextureObject", {"hipDestroyTextureObject", CONV_TEX, API_RUNTIME}}, + {"cudaGetTextureObjectResourceDesc", + {"hipGetTextureObjectResourceDesc", CONV_TEX, API_RUNTIME}}, + {"cudaGetTextureObjectResourceViewDesc", + {"hipGetTextureObjectResourceViewDesc", CONV_TEX, API_RUNTIME}}, + {"cudaGetTextureObjectTextureDesc", {"hipGetTextureObjectTextureDesc", CONV_TEX, API_RUNTIME}}, // Surface Reference Management - {"cudaBindSurfaceToArray", {"hipBindSurfaceToArray", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGetSurfaceReference", {"hipGetSurfaceReference", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaBindSurfaceToArray", + {"hipBindSurfaceToArray", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGetSurfaceReference", + {"hipGetSurfaceReference", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, // enum cudaSurfaceBoundaryMode - {"cudaBoundaryModeZero", {"hipBoundaryModeZero", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaBoundaryModeClamp", {"hipBoundaryModeClamp", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaBoundaryModeTrap", {"hipBoundaryModeTrap", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaBoundaryModeZero", {"hipBoundaryModeZero", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaBoundaryModeClamp", {"hipBoundaryModeClamp", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaBoundaryModeTrap", {"hipBoundaryModeTrap", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, // enum cudaSurfaceFormatMode - {"cudaFormatModeForced", {"hipFormatModeForced", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaFormatModeAuto", {"hipFormatModeAuto", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaFormatModeForced", {"hipFormatModeForced", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaFormatModeAuto", {"hipFormatModeAuto", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, // Surface Object Management - {"cudaCreateSurfaceObject", {"hipCreateSurfaceObject", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaDestroySurfaceObject", {"hipDestroySurfaceObject", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGetSurfaceObjectResourceDesc", {"hipGetSurfaceObjectResourceDesc", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaCreateSurfaceObject", + {"hipCreateSurfaceObject", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaDestroySurfaceObject", + {"hipDestroySurfaceObject", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGetSurfaceObjectResourceDesc", + {"hipGetSurfaceObjectResourceDesc", CONV_SURFACE, API_RUNTIME, HIP_UNSUPPORTED}}, // Inter-Process Communications (IPC) - {"cudaIpcCloseMemHandle", {"hipIpcCloseMemHandle", CONV_DEVICE, API_RUNTIME}}, - {"cudaIpcGetEventHandle", {"hipIpcGetEventHandle", CONV_DEVICE, API_RUNTIME}}, - {"cudaIpcGetMemHandle", {"hipIpcGetMemHandle", CONV_DEVICE, API_RUNTIME}}, + {"cudaIpcCloseMemHandle", {"hipIpcCloseMemHandle", CONV_DEVICE, API_RUNTIME}}, + {"cudaIpcGetEventHandle", {"hipIpcGetEventHandle", CONV_DEVICE, API_RUNTIME}}, + {"cudaIpcGetMemHandle", {"hipIpcGetMemHandle", CONV_DEVICE, API_RUNTIME}}, {"cudaIpcOpenEventHandle", {"hipIpcOpenEventHandle", CONV_DEVICE, API_RUNTIME}}, - {"cudaIpcOpenMemHandle", {"hipIpcOpenMemHandle", CONV_DEVICE, API_RUNTIME}}, + {"cudaIpcOpenMemHandle", {"hipIpcOpenMemHandle", CONV_DEVICE, API_RUNTIME}}, // OpenGL Interoperability - {"cudaGLGetDevices", {"hipGLGetDevices", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGraphicsGLRegisterBuffer", {"hipGraphicsGLRegisterBuffer", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGraphicsGLRegisterImage", {"hipGraphicsGLRegisterImage", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaWGLGetDevice", {"hipWGLGetDevice", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGLGetDevices", {"hipGLGetDevices", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGraphicsGLRegisterBuffer", + {"hipGraphicsGLRegisterBuffer", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGraphicsGLRegisterImage", + {"hipGraphicsGLRegisterImage", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaWGLGetDevice", {"hipWGLGetDevice", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // Graphics Interoperability - {"cudaGraphicsMapResources", {"hipGraphicsMapResources", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsMapResources) - {"cudaGraphicsResourceGetMappedMipmappedArray", {"hipGraphicsResourceGetMappedMipmappedArray", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsResourceGetMappedMipmappedArray) - {"cudaGraphicsResourceGetMappedPointer", {"hipGraphicsResourceGetMappedPointer", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsResourceGetMappedPointer) - {"cudaGraphicsResourceSetMapFlags", {"hipGraphicsResourceSetMapFlags", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsResourceSetMapFlags) - {"cudaGraphicsSubResourceGetMappedArray", {"hipGraphicsSubResourceGetMappedArray", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsSubResourceGetMappedArray) - {"cudaGraphicsUnmapResources", {"hipGraphicsUnmapResources", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsUnmapResources) - {"cudaGraphicsUnregisterResource", {"hipGraphicsUnregisterResource", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsUnregisterResource) + {"cudaGraphicsMapResources", + {"hipGraphicsMapResources", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsMapResources) + {"cudaGraphicsResourceGetMappedMipmappedArray", + {"hipGraphicsResourceGetMappedMipmappedArray", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsResourceGetMappedMipmappedArray) + {"cudaGraphicsResourceGetMappedPointer", + {"hipGraphicsResourceGetMappedPointer", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsResourceGetMappedPointer) + {"cudaGraphicsResourceSetMapFlags", + {"hipGraphicsResourceSetMapFlags", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsResourceSetMapFlags) + {"cudaGraphicsSubResourceGetMappedArray", + {"hipGraphicsSubResourceGetMappedArray", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsSubResourceGetMappedArray) + {"cudaGraphicsUnmapResources", + {"hipGraphicsUnmapResources", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsUnmapResources) + {"cudaGraphicsUnregisterResource", + {"hipGraphicsUnregisterResource", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsUnregisterResource) // enum cudaGraphicsCubeFace - {"cudaGraphicsCubeFacePositiveX", {"hipGraphicsCubeFacePositiveX", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGraphicsCubeFaceNegativeX", {"hipGraphicsCubeFaceNegativeX", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGraphicsCubeFacePositiveY", {"hipGraphicsCubeFacePositiveY", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGraphicsCubeFaceNegativeY", {"hipGraphicsCubeFaceNegativeY", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGraphicsCubeFacePositiveZ", {"hipGraphicsCubeFacePositiveZ", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, - {"cudaGraphicsCubeFaceNegativeZ", {"hipGraphicsCubeFaceNegativeZ", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGraphicsCubeFacePositiveX", + {"hipGraphicsCubeFacePositiveX", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGraphicsCubeFaceNegativeX", + {"hipGraphicsCubeFaceNegativeX", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGraphicsCubeFacePositiveY", + {"hipGraphicsCubeFacePositiveY", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGraphicsCubeFaceNegativeY", + {"hipGraphicsCubeFaceNegativeY", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGraphicsCubeFacePositiveZ", + {"hipGraphicsCubeFacePositiveZ", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, + {"cudaGraphicsCubeFaceNegativeZ", + {"hipGraphicsCubeFaceNegativeZ", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // enum cudaGraphicsMapFlags - {"cudaGraphicsMapFlagsNone", {"hipGraphicsMapFlagsNone", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // 0 // API_Driver ANALOGUE (CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = 0x00) - {"cudaGraphicsMapFlagsReadOnly", {"hipGraphicsMapFlagsReadOnly", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = 0x01) - {"cudaGraphicsMapFlagsWriteDiscard", {"hipGraphicsMapFlagsWriteDiscard", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02) + {"cudaGraphicsMapFlagsNone", + {"hipGraphicsMapFlagsNone", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0 // API_Driver ANALOGUE (CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = 0x00) + {"cudaGraphicsMapFlagsReadOnly", + {"hipGraphicsMapFlagsReadOnly", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = + // 0x01) + {"cudaGraphicsMapFlagsWriteDiscard", + {"hipGraphicsMapFlagsWriteDiscard", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD + // = 0x02) // enum cudaGraphicsRegisterFlags - {"cudaGraphicsRegisterFlagsNone", {"hipGraphicsRegisterFlagsNone", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // 0 // API_Driver ANALOGUE (CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = 0x00) - {"cudaGraphicsRegisterFlagsReadOnly", {"hipGraphicsRegisterFlagsReadOnly", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = 0x01) - {"cudaGraphicsRegisterFlagsWriteDiscard", {"hipGraphicsRegisterFlagsWriteDiscard", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD = 0x02) - {"cudaGraphicsRegisterFlagsSurfaceLoadStore", {"hipGraphicsRegisterFlagsSurfaceLoadStore", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // 4 // API_Driver ANALOGUE (CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST = 0x04) - {"cudaGraphicsRegisterFlagsTextureGather", {"hipGraphicsRegisterFlagsTextureGather", CONV_GRAPHICS, API_RUNTIME, HIP_UNSUPPORTED}}, // 8 // API_Driver ANALOGUE (CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = 0x08) + {"cudaGraphicsRegisterFlagsNone", + {"hipGraphicsRegisterFlagsNone", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0 // API_Driver ANALOGUE (CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = 0x00) + {"cudaGraphicsRegisterFlagsReadOnly", + {"hipGraphicsRegisterFlagsReadOnly", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = + // 0x01) + {"cudaGraphicsRegisterFlagsWriteDiscard", + {"hipGraphicsRegisterFlagsWriteDiscard", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD = + // 0x02) + {"cudaGraphicsRegisterFlagsSurfaceLoadStore", + {"hipGraphicsRegisterFlagsSurfaceLoadStore", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // 4 // API_Driver ANALOGUE (CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST = + // 0x04) + {"cudaGraphicsRegisterFlagsTextureGather", + {"hipGraphicsRegisterFlagsTextureGather", CONV_GRAPHICS, API_RUNTIME, + HIP_UNSUPPORTED}}, // 8 // API_Driver ANALOGUE (CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = + // 0x08) // OpenGL Interoperability // enum cudaGLDeviceList - {"cudaGLDeviceListAll", {"HIP_GL_DEVICE_LIST_ALL", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x01 // API_Driver ANALOGUE (CU_GL_DEVICE_LIST_ALL) - {"cudaGLDeviceListCurrentFrame", {"HIP_GL_DEVICE_LIST_CURRENT_FRAME", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x02 // API_Driver ANALOGUE (CU_GL_DEVICE_LIST_CURRENT_FRAME) - {"cudaGLDeviceListNextFrame", {"HIP_GL_DEVICE_LIST_NEXT_FRAME", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x03 // API_Driver ANALOGUE (CU_GL_DEVICE_LIST_NEXT_FRAME) + {"cudaGLDeviceListAll", + {"HIP_GL_DEVICE_LIST_ALL", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x01 // API_Driver ANALOGUE (CU_GL_DEVICE_LIST_ALL) + {"cudaGLDeviceListCurrentFrame", + {"HIP_GL_DEVICE_LIST_CURRENT_FRAME", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x02 // API_Driver ANALOGUE (CU_GL_DEVICE_LIST_CURRENT_FRAME) + {"cudaGLDeviceListNextFrame", + {"HIP_GL_DEVICE_LIST_NEXT_FRAME", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x03 // API_Driver ANALOGUE (CU_GL_DEVICE_LIST_NEXT_FRAME) - {"cudaGLGetDevices", {"hipGLGetDevices", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGLGetDevices) - {"cudaGraphicsGLRegisterBuffer", {"hipGraphicsGLRegisterBuffer", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsGLRegisterBuffer) - {"cudaGraphicsGLRegisterImage", {"hipGraphicsGLRegisterImage", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsGLRegisterImage) - {"cudaWGLGetDevice", {"hipWGLGetDevice", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuWGLGetDevice) + {"cudaGLGetDevices", + {"hipGLGetDevices", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGLGetDevices) + {"cudaGraphicsGLRegisterBuffer", + {"hipGraphicsGLRegisterBuffer", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsGLRegisterBuffer) + {"cudaGraphicsGLRegisterImage", + {"hipGraphicsGLRegisterImage", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsGLRegisterImage) + {"cudaWGLGetDevice", + {"hipWGLGetDevice", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuWGLGetDevice) // OpenGL Interoperability [DEPRECATED] // enum cudaGLMapFlags - {"cudaGLMapFlagsNone", {"HIP_GL_MAP_RESOURCE_FLAGS_NONE", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x00 // API_Driver ANALOGUE (CU_GL_MAP_RESOURCE_FLAGS_NONE) - {"cudaGLMapFlagsReadOnly", {"HIP_GL_MAP_RESOURCE_FLAGS_READ_ONLY", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x01 // API_Driver ANALOGUE (CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY) - {"cudaGLMapFlagsWriteDiscard", {"HIP_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // 0x02 // API_Driver ANALOGUE (CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD) + {"cudaGLMapFlagsNone", + {"HIP_GL_MAP_RESOURCE_FLAGS_NONE", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x00 // API_Driver ANALOGUE (CU_GL_MAP_RESOURCE_FLAGS_NONE) + {"cudaGLMapFlagsReadOnly", + {"HIP_GL_MAP_RESOURCE_FLAGS_READ_ONLY", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x01 // API_Driver ANALOGUE (CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY) + {"cudaGLMapFlagsWriteDiscard", + {"HIP_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0x02 // API_Driver ANALOGUE (CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD) - {"cudaGLMapBufferObject", {"hipGLMapBufferObject__", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // Not equal to cuGLMapBufferObject due to different signatures - {"cudaGLMapBufferObjectAsync", {"hipGLMapBufferObjectAsync__", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // Not equal to cuGLMapBufferObjectAsync due to different signatures - {"cudaGLRegisterBufferObject", {"hipGLRegisterBufferObject", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGLRegisterBufferObject) - {"cudaGLSetBufferObjectMapFlags", {"hipGLSetBufferObjectMapFlags", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGLSetBufferObjectMapFlags) - {"cudaGLSetGLDevice", {"hipGLSetGLDevice", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // no API_Driver ANALOGUE - {"cudaGLUnmapBufferObject", {"hipGLUnmapBufferObject", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGLUnmapBufferObject) - {"cudaGLUnmapBufferObjectAsync", {"hipGLUnmapBufferObjectAsync", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGLUnmapBufferObjectAsync) - {"cudaGLUnregisterBufferObject", {"hipGLUnregisterBufferObject", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGLUnregisterBufferObject) + {"cudaGLMapBufferObject", + {"hipGLMapBufferObject__", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // Not equal to cuGLMapBufferObject due to different signatures + {"cudaGLMapBufferObjectAsync", + {"hipGLMapBufferObjectAsync__", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // Not equal to cuGLMapBufferObjectAsync due to different signatures + {"cudaGLRegisterBufferObject", + {"hipGLRegisterBufferObject", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGLRegisterBufferObject) + {"cudaGLSetBufferObjectMapFlags", + {"hipGLSetBufferObjectMapFlags", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGLSetBufferObjectMapFlags) + {"cudaGLSetGLDevice", + {"hipGLSetGLDevice", CONV_GL, API_RUNTIME, HIP_UNSUPPORTED}}, // no API_Driver ANALOGUE + {"cudaGLUnmapBufferObject", + {"hipGLUnmapBufferObject", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGLUnmapBufferObject) + {"cudaGLUnmapBufferObjectAsync", + {"hipGLUnmapBufferObjectAsync", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGLUnmapBufferObjectAsync) + {"cudaGLUnregisterBufferObject", + {"hipGLUnregisterBufferObject", CONV_GL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGLUnregisterBufferObject) // Direct3D 9 Interoperability // enum CUd3d9DeviceList - {"cudaD3D9DeviceListAll", {"HIP_D3D9_DEVICE_LIST_ALL", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D9_DEVICE_LIST_ALL) - {"cudaD3D9DeviceListCurrentFrame", {"HIP_D3D9_DEVICE_LIST_CURRENT_FRAME", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_D3D9_DEVICE_LIST_CURRENT_FRAME) - {"cudaD3D9DeviceListNextFrame", {"HIP_D3D9_DEVICE_LIST_NEXT_FRAME", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // 3 // API_Driver ANALOGUE (CU_D3D9_DEVICE_LIST_NEXT_FRAME) + {"cudaD3D9DeviceListAll", + {"HIP_D3D9_DEVICE_LIST_ALL", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D9_DEVICE_LIST_ALL) + {"cudaD3D9DeviceListCurrentFrame", + {"HIP_D3D9_DEVICE_LIST_CURRENT_FRAME", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_D3D9_DEVICE_LIST_CURRENT_FRAME) + {"cudaD3D9DeviceListNextFrame", + {"HIP_D3D9_DEVICE_LIST_NEXT_FRAME", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // 3 // API_Driver ANALOGUE (CU_D3D9_DEVICE_LIST_NEXT_FRAME) - {"cudaD3D9GetDevice", {"hipD3D9GetDevice", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9GetDevice) - {"cudaD3D9GetDevices", {"hipD3D9GetDevices", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9GetDevices) - {"cudaD3D9GetDirect3DDevice", {"hipD3D9GetDirect3DDevice", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9GetDirect3DDevice) - {"cudaD3D9SetDirect3DDevice", {"hipD3D9SetDirect3DDevice", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // no API_Driver ANALOGUE - {"cudaGraphicsD3D9RegisterResource", {"hipGraphicsD3D9RegisterResource", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsD3D9RegisterResource) + {"cudaD3D9GetDevice", + {"hipD3D9GetDevice", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9GetDevice) + {"cudaD3D9GetDevices", + {"hipD3D9GetDevices", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9GetDevices) + {"cudaD3D9GetDirect3DDevice", + {"hipD3D9GetDirect3DDevice", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9GetDirect3DDevice) + {"cudaD3D9SetDirect3DDevice", + {"hipD3D9SetDirect3DDevice", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // no API_Driver ANALOGUE + {"cudaGraphicsD3D9RegisterResource", + {"hipGraphicsD3D9RegisterResource", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsD3D9RegisterResource) // Direct3D 9 Interoperability [DEPRECATED] // enum cudaD3D9MapFlags - {"cudaD3D9MapFlags", {"hipD3D9MapFlags", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d9map_flags) - {"cudaD3D9MapFlagsNone", {"HIP_D3D9_MAPRESOURCE_FLAGS_NONE", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // 0 // API_Driver ANALOGUE (CU_D3D9_MAPRESOURCE_FLAGS_NONE) - {"cudaD3D9MapFlagsReadOnly", {"HIP_D3D9_MAPRESOURCE_FLAGS_READONLY", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D9_MAPRESOURCE_FLAGS_READONLY) - {"cudaD3D9MapFlagsWriteDiscard", {"HIP_D3D9_MAPRESOURCE_FLAGS_WRITEDISCARD", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_D3D9_MAPRESOURCE_FLAGS_WRITEDISCARD) + {"cudaD3D9MapFlags", + {"hipD3D9MapFlags", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (CUd3d9map_flags) + {"cudaD3D9MapFlagsNone", + {"HIP_D3D9_MAPRESOURCE_FLAGS_NONE", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0 // API_Driver ANALOGUE (CU_D3D9_MAPRESOURCE_FLAGS_NONE) + {"cudaD3D9MapFlagsReadOnly", + {"HIP_D3D9_MAPRESOURCE_FLAGS_READONLY", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D9_MAPRESOURCE_FLAGS_READONLY) + {"cudaD3D9MapFlagsWriteDiscard", + {"HIP_D3D9_MAPRESOURCE_FLAGS_WRITEDISCARD", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_D3D9_MAPRESOURCE_FLAGS_WRITEDISCARD) // enum cudaD3D9RegisterFlags - {"cudaD3D9RegisterFlagsNone", {"HIP_D3D9_REGISTER_FLAGS_NONE", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // 0 // API_Driver ANALOGUE (CU_D3D9_REGISTER_FLAGS_NONE) - {"cudaD3D9RegisterFlagsArray", {"HIP_D3D9_REGISTER_FLAGS_ARRAY", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D9_REGISTER_FLAGS_ARRAY) + {"cudaD3D9RegisterFlagsNone", + {"HIP_D3D9_REGISTER_FLAGS_NONE", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0 // API_Driver ANALOGUE (CU_D3D9_REGISTER_FLAGS_NONE) + {"cudaD3D9RegisterFlagsArray", + {"HIP_D3D9_REGISTER_FLAGS_ARRAY", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D9_REGISTER_FLAGS_ARRAY) - {"cudaD3D9MapResources", {"hipD3D9MapResources", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9MapResources) - {"cudaD3D9RegisterResource", {"hipD3D9RegisterResource", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9RegisterResource) - {"cudaD3D9ResourceGetMappedArray", {"hipD3D9ResourceGetMappedArray", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9ResourceGetMappedArray) - {"cudaD3D9ResourceGetMappedPitch", {"hipD3D9ResourceGetMappedPitch", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cudaD3D9ResourceGetMappedPitch) - {"cudaD3D9ResourceGetMappedPointer", {"hipD3D9ResourceGetMappedPointer", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9ResourceGetMappedPointer) - {"cudaD3D9ResourceGetMappedSize", {"hipD3D9ResourceGetMappedSize", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9ResourceGetMappedSize) - {"cudaD3D9ResourceGetSurfaceDimensions", {"hipD3D9ResourceGetSurfaceDimensions", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9ResourceGetSurfaceDimensions) - {"cudaD3D9ResourceSetMapFlags", {"hipD3D9ResourceSetMapFlags", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9ResourceSetMapFlags) - {"cudaD3D9UnmapResources", {"hipD3D9UnmapResources", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9UnmapResources) - {"cudaD3D9UnregisterResource", {"hipD3D9UnregisterResource", CONV_D3D9, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9UnregisterResource) + {"cudaD3D9MapResources", + {"hipD3D9MapResources", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9MapResources) + {"cudaD3D9RegisterResource", + {"hipD3D9RegisterResource", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9RegisterResource) + {"cudaD3D9ResourceGetMappedArray", + {"hipD3D9ResourceGetMappedArray", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9ResourceGetMappedArray) + {"cudaD3D9ResourceGetMappedPitch", + {"hipD3D9ResourceGetMappedPitch", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cudaD3D9ResourceGetMappedPitch) + {"cudaD3D9ResourceGetMappedPointer", + {"hipD3D9ResourceGetMappedPointer", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9ResourceGetMappedPointer) + {"cudaD3D9ResourceGetMappedSize", + {"hipD3D9ResourceGetMappedSize", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9ResourceGetMappedSize) + {"cudaD3D9ResourceGetSurfaceDimensions", + {"hipD3D9ResourceGetSurfaceDimensions", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9ResourceGetSurfaceDimensions) + {"cudaD3D9ResourceSetMapFlags", + {"hipD3D9ResourceSetMapFlags", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9ResourceSetMapFlags) + {"cudaD3D9UnmapResources", + {"hipD3D9UnmapResources", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9UnmapResources) + {"cudaD3D9UnregisterResource", + {"hipD3D9UnregisterResource", CONV_D3D9, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D9UnregisterResource) // Direct3D 10 Interoperability // enum cudaD3D10DeviceList - {"cudaD3D10DeviceListAll", {"HIP_D3D10_DEVICE_LIST_ALL", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D10_DEVICE_LIST_ALL) - {"cudaD3D10DeviceListCurrentFrame", {"HIP_D3D10_DEVICE_LIST_CURRENT_FRAME", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_D3D10_DEVICE_LIST_CURRENT_FRAME) - {"cudaD3D10DeviceListNextFrame", {"HIP_D3D10_DEVICE_LIST_NEXT_FRAME", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // 3 // API_Driver ANALOGUE (CU_D3D10_DEVICE_LIST_NEXT_FRAME) - {"cudaD3D10GetDevice", {"hipD3D10GetDevice", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10GetDevice) - {"cudaD3D10GetDevices", {"hipD3D10GetDevices", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10GetDevices) - {"cudaGraphicsD3D10RegisterResource", {"hipGraphicsD3D10RegisterResource", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsD3D10RegisterResource) + {"cudaD3D10DeviceListAll", + {"HIP_D3D10_DEVICE_LIST_ALL", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D10_DEVICE_LIST_ALL) + {"cudaD3D10DeviceListCurrentFrame", + {"HIP_D3D10_DEVICE_LIST_CURRENT_FRAME", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_D3D10_DEVICE_LIST_CURRENT_FRAME) + {"cudaD3D10DeviceListNextFrame", + {"HIP_D3D10_DEVICE_LIST_NEXT_FRAME", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // 3 // API_Driver ANALOGUE (CU_D3D10_DEVICE_LIST_NEXT_FRAME) + {"cudaD3D10GetDevice", + {"hipD3D10GetDevice", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10GetDevice) + {"cudaD3D10GetDevices", + {"hipD3D10GetDevices", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10GetDevices) + {"cudaGraphicsD3D10RegisterResource", + {"hipGraphicsD3D10RegisterResource", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsD3D10RegisterResource) // Direct3D 10 Interoperability [DEPRECATED] // enum cudaD3D10MapFlags - {"cudaD3D10MapFlagsNone", {"HIP_D3D10_MAPRESOURCE_FLAGS_NONE", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // 0 // API_Driver ANALOGUE (CU_D3D10_MAPRESOURCE_FLAGS_NONE) - {"cudaD3D10MapFlagsReadOnly", {"HIP_D3D10_MAPRESOURCE_FLAGS_READONLY", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D10_MAPRESOURCE_FLAGS_READONLY) - {"cudaD3D10MapFlagsWriteDiscard", {"HIP_D3D10_MAPRESOURCE_FLAGS_WRITEDISCARD", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_D3D10_MAPRESOURCE_FLAGS_WRITEDISCARD) + {"cudaD3D10MapFlagsNone", + {"HIP_D3D10_MAPRESOURCE_FLAGS_NONE", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0 // API_Driver ANALOGUE (CU_D3D10_MAPRESOURCE_FLAGS_NONE) + {"cudaD3D10MapFlagsReadOnly", + {"HIP_D3D10_MAPRESOURCE_FLAGS_READONLY", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D10_MAPRESOURCE_FLAGS_READONLY) + {"cudaD3D10MapFlagsWriteDiscard", + {"HIP_D3D10_MAPRESOURCE_FLAGS_WRITEDISCARD", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_D3D10_MAPRESOURCE_FLAGS_WRITEDISCARD) // enum cudaD3D10RegisterFlags - {"cudaD3D10RegisterFlagsNone", {"HIP_D3D10_REGISTER_FLAGS_NONE", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // 0 // API_Driver ANALOGUE (CU_D3D10_REGISTER_FLAGS_NONE) - {"cudaD3D10RegisterFlagsArray", {"HIP_D3D10_REGISTER_FLAGS_ARRAY", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D10_REGISTER_FLAGS_ARRAY) + {"cudaD3D10RegisterFlagsNone", + {"HIP_D3D10_REGISTER_FLAGS_NONE", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // 0 // API_Driver ANALOGUE (CU_D3D10_REGISTER_FLAGS_NONE) + {"cudaD3D10RegisterFlagsArray", + {"HIP_D3D10_REGISTER_FLAGS_ARRAY", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D10_REGISTER_FLAGS_ARRAY) - {"cudaD3D10GetDirect3DDevice", {"hipD3D10GetDirect3DDevice", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cudaD3D10GetDirect3DDevice) - {"cudaD3D10MapResources", {"hipD3D10MapResources", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10MapResources) - {"cudaD3D10RegisterResource", {"hipD3D10RegisterResource", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10RegisterResource) - {"cudaD3D10ResourceGetMappedArray", {"hipD3D10ResourceGetMappedArray", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10ResourceGetMappedArray) - {"cudaD3D10ResourceGetMappedPitch", {"hipD3D10ResourceGetMappedPitch", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cudaD3D10ResourceGetMappedPitch) - {"cudaD3D10ResourceGetMappedPointer", {"hipD3D10ResourceGetMappedPointer", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10ResourceGetMappedPointer) - {"cudaD3D10ResourceGetMappedSize", {"hipD3D10ResourceGetMappedSize", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10ResourceGetMappedSize) - {"cudaD3D10ResourceGetSurfaceDimensions", {"hipD3D10ResourceGetSurfaceDimensions", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10ResourceGetSurfaceDimensions) - {"cudaD3D10ResourceSetMapFlags", {"hipD3D10ResourceSetMapFlags", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10ResourceSetMapFlags) - {"cudaD3D10SetDirect3DDevice", {"hipD3D10SetDirect3DDevice", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // no API_Driver ANALOGUE - {"cudaD3D10UnmapResources", {"hipD3D10UnmapResources", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10UnmapResources) - {"cudaD3D10UnregisterResource", {"hipD3D10UnregisterResource", CONV_D3D10, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10UnregisterResource) + {"cudaD3D10GetDirect3DDevice", + {"hipD3D10GetDirect3DDevice", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cudaD3D10GetDirect3DDevice) + {"cudaD3D10MapResources", + {"hipD3D10MapResources", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10MapResources) + {"cudaD3D10RegisterResource", + {"hipD3D10RegisterResource", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10RegisterResource) + {"cudaD3D10ResourceGetMappedArray", + {"hipD3D10ResourceGetMappedArray", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10ResourceGetMappedArray) + {"cudaD3D10ResourceGetMappedPitch", + {"hipD3D10ResourceGetMappedPitch", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cudaD3D10ResourceGetMappedPitch) + {"cudaD3D10ResourceGetMappedPointer", + {"hipD3D10ResourceGetMappedPointer", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10ResourceGetMappedPointer) + {"cudaD3D10ResourceGetMappedSize", + {"hipD3D10ResourceGetMappedSize", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10ResourceGetMappedSize) + {"cudaD3D10ResourceGetSurfaceDimensions", + {"hipD3D10ResourceGetSurfaceDimensions", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10ResourceGetSurfaceDimensions) + {"cudaD3D10ResourceSetMapFlags", + {"hipD3D10ResourceSetMapFlags", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10ResourceSetMapFlags) + {"cudaD3D10SetDirect3DDevice", + {"hipD3D10SetDirect3DDevice", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // no API_Driver ANALOGUE + {"cudaD3D10UnmapResources", + {"hipD3D10UnmapResources", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10UnmapResources) + {"cudaD3D10UnregisterResource", + {"hipD3D10UnregisterResource", CONV_D3D10, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D10UnregisterResource) // Direct3D 11 Interoperability // enum cudaD3D11DeviceList - {"cudaD3D11DeviceListAll", {"HIP_D3D11_DEVICE_LIST_ALL", CONV_D3D11, API_RUNTIME, HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D11_DEVICE_LIST_ALL) - {"cudaD3D11DeviceListCurrentFrame", {"HIP_D3D11_DEVICE_LIST_CURRENT_FRAME", CONV_D3D11, API_RUNTIME, HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_D3D11_DEVICE_LIST_CURRENT_FRAME) - {"cudaD3D11DeviceListNextFrame", {"HIP_D3D11_DEVICE_LIST_NEXT_FRAME", CONV_D3D11, API_RUNTIME, HIP_UNSUPPORTED}}, // 3 // API_Driver ANALOGUE (CU_D3D11_DEVICE_LIST_NEXT_FRAME) + {"cudaD3D11DeviceListAll", + {"HIP_D3D11_DEVICE_LIST_ALL", CONV_D3D11, API_RUNTIME, + HIP_UNSUPPORTED}}, // 1 // API_Driver ANALOGUE (CU_D3D11_DEVICE_LIST_ALL) + {"cudaD3D11DeviceListCurrentFrame", + {"HIP_D3D11_DEVICE_LIST_CURRENT_FRAME", CONV_D3D11, API_RUNTIME, + HIP_UNSUPPORTED}}, // 2 // API_Driver ANALOGUE (CU_D3D11_DEVICE_LIST_CURRENT_FRAME) + {"cudaD3D11DeviceListNextFrame", + {"HIP_D3D11_DEVICE_LIST_NEXT_FRAME", CONV_D3D11, API_RUNTIME, + HIP_UNSUPPORTED}}, // 3 // API_Driver ANALOGUE (CU_D3D11_DEVICE_LIST_NEXT_FRAME) - {"cudaD3D11GetDevice", {"hipD3D11GetDevice", CONV_D3D11, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D11GetDevice) - {"cudaD3D11GetDevices", {"hipD3D11GetDevices", CONV_D3D11, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D11GetDevices) - {"cudaGraphicsD3D11RegisterResource", {"hipGraphicsD3D11RegisterResource", CONV_D3D11, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsD3D11RegisterResource) + {"cudaD3D11GetDevice", + {"hipD3D11GetDevice", CONV_D3D11, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D11GetDevice) + {"cudaD3D11GetDevices", + {"hipD3D11GetDevices", CONV_D3D11, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D11GetDevices) + {"cudaGraphicsD3D11RegisterResource", + {"hipGraphicsD3D11RegisterResource", CONV_D3D11, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsD3D11RegisterResource) // Direct3D 11 Interoperability [DEPRECATED] - {"cudaD3D11GetDevice", {"hipD3D11GetDevice", CONV_D3D11, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D11GetDevice) - {"cudaD3D11GetDevices", {"hipD3D11GetDevices", CONV_D3D11, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D11GetDevices) - {"cudaGraphicsD3D11RegisterResource", {"hipGraphicsD3D11RegisterResource", CONV_D3D11, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsD3D11RegisterResource) + {"cudaD3D11GetDevice", + {"hipD3D11GetDevice", CONV_D3D11, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D11GetDevice) + {"cudaD3D11GetDevices", + {"hipD3D11GetDevices", CONV_D3D11, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuD3D11GetDevices) + {"cudaGraphicsD3D11RegisterResource", + {"hipGraphicsD3D11RegisterResource", CONV_D3D11, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsD3D11RegisterResource) // VDPAU Interoperability - {"cudaGraphicsVDPAURegisterOutputSurface", {"hipGraphicsVDPAURegisterOutputSurface", CONV_VDPAU, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsVDPAURegisterOutputSurface) - {"cudaGraphicsVDPAURegisterVideoSurface", {"hipGraphicsVDPAURegisterVideoSurface", CONV_VDPAU, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsVDPAURegisterVideoSurface) - {"cudaVDPAUGetDevice", {"hipVDPAUGetDevice", CONV_VDPAU, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuVDPAUGetDevice) - {"cudaVDPAUSetVDPAUDevice", {"hipVDPAUSetDevice", CONV_VDPAU, API_RUNTIME, HIP_UNSUPPORTED}}, // no API_Driver ANALOGUE + {"cudaGraphicsVDPAURegisterOutputSurface", + {"hipGraphicsVDPAURegisterOutputSurface", CONV_VDPAU, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsVDPAURegisterOutputSurface) + {"cudaGraphicsVDPAURegisterVideoSurface", + {"hipGraphicsVDPAURegisterVideoSurface", CONV_VDPAU, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsVDPAURegisterVideoSurface) + {"cudaVDPAUGetDevice", + {"hipVDPAUGetDevice", CONV_VDPAU, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuVDPAUGetDevice) + {"cudaVDPAUSetVDPAUDevice", + {"hipVDPAUSetDevice", CONV_VDPAU, API_RUNTIME, HIP_UNSUPPORTED}}, // no API_Driver ANALOGUE // EGL Interoperability - {"cudaEGLStreamConsumerAcquireFrame", {"hipEGLStreamConsumerAcquireFrame", CONV_EGL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamConsumerAcquireFrame) - {"cudaEGLStreamConsumerConnect", {"hipEGLStreamConsumerConnect", CONV_EGL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamConsumerConnect) - {"cudaEGLStreamConsumerConnectWithFlags", {"hipEGLStreamConsumerConnectWithFlags", CONV_EGL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamConsumerConnectWithFlags) - {"cudaEGLStreamConsumerReleaseFrame", {"hipEGLStreamConsumerReleaseFrame", CONV_EGL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamConsumerReleaseFrame) - {"cudaEGLStreamProducerConnect", {"hipEGLStreamProducerConnect", CONV_EGL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamProducerConnect) - {"cudaEGLStreamProducerDisconnect", {"hipEGLStreamProducerDisconnect", CONV_EGL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamProducerDisconnect) - {"cudaEGLStreamProducerPresentFrame", {"hipEGLStreamProducerPresentFrame", CONV_EGL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamProducerPresentFrame) - {"cudaEGLStreamProducerReturnFrame", {"hipEGLStreamProducerReturnFrame", CONV_EGL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamProducerReturnFrame) - {"cudaGraphicsEGLRegisterImage", {"hipGraphicsEGLRegisterImage", CONV_EGL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsEGLRegisterImage) - {"cudaGraphicsResourceGetMappedEglFrame", {"hipGraphicsResourceGetMappedEglFrame", CONV_EGL, API_RUNTIME, HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsResourceGetMappedEglFrame) + {"cudaEGLStreamConsumerAcquireFrame", + {"hipEGLStreamConsumerAcquireFrame", CONV_EGL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamConsumerAcquireFrame) + {"cudaEGLStreamConsumerConnect", + {"hipEGLStreamConsumerConnect", CONV_EGL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamConsumerConnect) + {"cudaEGLStreamConsumerConnectWithFlags", + {"hipEGLStreamConsumerConnectWithFlags", CONV_EGL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamConsumerConnectWithFlags) + {"cudaEGLStreamConsumerReleaseFrame", + {"hipEGLStreamConsumerReleaseFrame", CONV_EGL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamConsumerReleaseFrame) + {"cudaEGLStreamProducerConnect", + {"hipEGLStreamProducerConnect", CONV_EGL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamProducerConnect) + {"cudaEGLStreamProducerDisconnect", + {"hipEGLStreamProducerDisconnect", CONV_EGL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamProducerDisconnect) + {"cudaEGLStreamProducerPresentFrame", + {"hipEGLStreamProducerPresentFrame", CONV_EGL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamProducerPresentFrame) + {"cudaEGLStreamProducerReturnFrame", + {"hipEGLStreamProducerReturnFrame", CONV_EGL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuEGLStreamProducerReturnFrame) + {"cudaGraphicsEGLRegisterImage", + {"hipGraphicsEGLRegisterImage", CONV_EGL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsEGLRegisterImage) + {"cudaGraphicsResourceGetMappedEglFrame", + {"hipGraphicsResourceGetMappedEglFrame", CONV_EGL, API_RUNTIME, + HIP_UNSUPPORTED}}, // API_Driver ANALOGUE (cuGraphicsResourceGetMappedEglFrame) ///////////////////////////// cuBLAS ///////////////////////////// // Blas management functions - {"cublasInit", {"hipblasInit", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasShutdown", {"hipblasShutdown", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasGetVersion", {"hipblasGetVersion", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasGetError", {"hipblasGetError", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasAlloc", {"hipblasAlloc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasFree", {"hipblasFree", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasSetKernelStream", {"hipblasSetKernelStream", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasGetAtomicsMode", {"hipblasGetAtomicsMode", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasSetAtomicsMode", {"hipblasSetAtomicsMode", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasGetMathMode", {"hipblasGetMathMode", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasSetMathMode", {"hipblasSetMathMode", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - + {"cublasInit", {"hipblasInit", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasShutdown", {"hipblasShutdown", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasGetVersion", {"hipblasGetVersion", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasGetError", {"hipblasGetError", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasAlloc", {"hipblasAlloc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasFree", {"hipblasFree", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSetKernelStream", + {"hipblasSetKernelStream", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasGetAtomicsMode", {"hipblasGetAtomicsMode", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSetAtomicsMode", {"hipblasSetAtomicsMode", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasGetMathMode", {"hipblasGetMathMode", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSetMathMode", {"hipblasSetMathMode", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // Blas operations (cublasOperation_t) - {"CUBLAS_OP_N", {"HIPBLAS_OP_N", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_OP_T", {"HIPBLAS_OP_T", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_OP_C", {"HIPBLAS_OP_C", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_OP_N", {"HIPBLAS_OP_N", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_OP_T", {"HIPBLAS_OP_T", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_OP_C", {"HIPBLAS_OP_C", CONV_NUMERIC_LITERAL, API_BLAS}}, // Blas statuses (cublasStatus_t) - {"CUBLAS_STATUS_SUCCESS", {"HIPBLAS_STATUS_SUCCESS", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_STATUS_NOT_INITIALIZED", {"HIPBLAS_STATUS_NOT_INITIALIZED", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_STATUS_ALLOC_FAILED", {"HIPBLAS_STATUS_ALLOC_FAILED", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_STATUS_INVALID_VALUE", {"HIPBLAS_STATUS_INVALID_VALUE", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_STATUS_MAPPING_ERROR", {"HIPBLAS_STATUS_MAPPING_ERROR", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_STATUS_EXECUTION_FAILED", {"HIPBLAS_STATUS_EXECUTION_FAILED", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_STATUS_INTERNAL_ERROR", {"HIPBLAS_STATUS_INTERNAL_ERROR", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_STATUS_NOT_SUPPORTED", {"HIPBLAS_STATUS_INTERNAL_ERROR", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_STATUS_SUCCESS", {"HIPBLAS_STATUS_SUCCESS", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_STATUS_NOT_INITIALIZED", + {"HIPBLAS_STATUS_NOT_INITIALIZED", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_STATUS_ALLOC_FAILED", {"HIPBLAS_STATUS_ALLOC_FAILED", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_STATUS_INVALID_VALUE", + {"HIPBLAS_STATUS_INVALID_VALUE", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_STATUS_MAPPING_ERROR", + {"HIPBLAS_STATUS_MAPPING_ERROR", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_STATUS_EXECUTION_FAILED", + {"HIPBLAS_STATUS_EXECUTION_FAILED", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_STATUS_INTERNAL_ERROR", + {"HIPBLAS_STATUS_INTERNAL_ERROR", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_STATUS_NOT_SUPPORTED", + {"HIPBLAS_STATUS_INTERNAL_ERROR", CONV_NUMERIC_LITERAL, API_BLAS}}, // Blas Fill Modes (cublasFillMode_t) - {"CUBLAS_FILL_MODE_LOWER", {"HIPBLAS_FILL_MODE_LOWER", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_FILL_MODE_UPPER", {"HIPBLAS_FILL_MODE_UPPER", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_FILL_MODE_LOWER", {"HIPBLAS_FILL_MODE_LOWER", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_FILL_MODE_UPPER", {"HIPBLAS_FILL_MODE_UPPER", CONV_NUMERIC_LITERAL, API_BLAS}}, // Blas Diag Types (cublasDiagType_t) - {"CUBLAS_DIAG_NON_UNIT", {"HIPBLAS_DIAG_NON_UNIT", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_DIAG_UNIT", {"HIPBLAS_DIAG_UNIT", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_DIAG_NON_UNIT", {"HIPBLAS_DIAG_NON_UNIT", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_DIAG_UNIT", {"HIPBLAS_DIAG_UNIT", CONV_NUMERIC_LITERAL, API_BLAS}}, // Blas Side Modes (cublasSideMode_t - {"CUBLAS_SIDE_LEFT", {"HIPBLAS_SIDE_LEFT", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_SIDE_RIGHT", {"HIPBLAS_SIDE_RIGHT", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_SIDE_LEFT", {"HIPBLAS_SIDE_LEFT", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_SIDE_RIGHT", {"HIPBLAS_SIDE_RIGHT", CONV_NUMERIC_LITERAL, API_BLAS}}, // Blas Pointer Modes (cublasPointerMode_t) - {"CUBLAS_POINTER_MODE_HOST", {"HIPBLAS_POINTER_MODE_HOST", CONV_NUMERIC_LITERAL, API_BLAS}}, - {"CUBLAS_POINTER_MODE_DEVICE", {"HIPBLAS_POINTER_MODE_DEVICE", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_POINTER_MODE_HOST", {"HIPBLAS_POINTER_MODE_HOST", CONV_NUMERIC_LITERAL, API_BLAS}}, + {"CUBLAS_POINTER_MODE_DEVICE", {"HIPBLAS_POINTER_MODE_DEVICE", CONV_NUMERIC_LITERAL, API_BLAS}}, // Blas Atomics Modes (cublasAtomicsMode_t) - {"CUBLAS_ATOMICS_NOT_ALLOWED", {"HIPBLAS_ATOMICS_NOT_ALLOWED", CONV_NUMERIC_LITERAL, API_BLAS, HIP_UNSUPPORTED}}, - {"CUBLAS_ATOMICS_ALLOWED", {"HIPBLAS_ATOMICS_ALLOWED", CONV_NUMERIC_LITERAL, API_BLAS, HIP_UNSUPPORTED}}, + {"CUBLAS_ATOMICS_NOT_ALLOWED", + {"HIPBLAS_ATOMICS_NOT_ALLOWED", CONV_NUMERIC_LITERAL, API_BLAS, HIP_UNSUPPORTED}}, + {"CUBLAS_ATOMICS_ALLOWED", + {"HIPBLAS_ATOMICS_ALLOWED", CONV_NUMERIC_LITERAL, API_BLAS, HIP_UNSUPPORTED}}, // Blas Data Type (cublasDataType_t) - {"CUBLAS_DATA_FLOAT", {"HIPBLAS_DATA_FLOAT", CONV_NUMERIC_LITERAL, API_BLAS, HIP_UNSUPPORTED}}, - {"CUBLAS_DATA_DOUBLE", {"HIPBLAS_DATA_DOUBLE", CONV_NUMERIC_LITERAL, API_BLAS, HIP_UNSUPPORTED}}, - {"CUBLAS_DATA_HALF", {"HIPBLAS_DATA_HALF", CONV_NUMERIC_LITERAL, API_BLAS, HIP_UNSUPPORTED}}, - {"CUBLAS_DATA_INT8", {"HIPBLAS_DATA_INT8", CONV_NUMERIC_LITERAL, API_BLAS, HIP_UNSUPPORTED}}, + {"CUBLAS_DATA_FLOAT", {"HIPBLAS_DATA_FLOAT", CONV_NUMERIC_LITERAL, API_BLAS, HIP_UNSUPPORTED}}, + {"CUBLAS_DATA_DOUBLE", + {"HIPBLAS_DATA_DOUBLE", CONV_NUMERIC_LITERAL, API_BLAS, HIP_UNSUPPORTED}}, + {"CUBLAS_DATA_HALF", {"HIPBLAS_DATA_HALF", CONV_NUMERIC_LITERAL, API_BLAS, HIP_UNSUPPORTED}}, + {"CUBLAS_DATA_INT8", {"HIPBLAS_DATA_INT8", CONV_NUMERIC_LITERAL, API_BLAS, HIP_UNSUPPORTED}}, // Blas1 (v1) Routines - {"cublasCreate", {"hipblasCreate", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDestroy", {"hipblasDestroy", CONV_MATH_FUNC, API_BLAS}}, + {"cublasCreate", {"hipblasCreate", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDestroy", {"hipblasDestroy", CONV_MATH_FUNC, API_BLAS}}, - {"cublasSetVector", {"hipblasSetVector", CONV_MATH_FUNC, API_BLAS}}, - {"cublasGetVector", {"hipblasGetVector", CONV_MATH_FUNC, API_BLAS}}, - {"cublasSetVectorAsync", {"hipblasSetVectorAsync", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasGetVectorAsync", {"hipblasGetVectorAsync", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSetVector", {"hipblasSetVector", CONV_MATH_FUNC, API_BLAS}}, + {"cublasGetVector", {"hipblasGetVector", CONV_MATH_FUNC, API_BLAS}}, + {"cublasSetVectorAsync", {"hipblasSetVectorAsync", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasGetVectorAsync", {"hipblasGetVectorAsync", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasSetMatrix", {"hipblasSetMatrix", CONV_MATH_FUNC, API_BLAS}}, - {"cublasGetMatrix", {"hipblasGetMatrix", CONV_MATH_FUNC, API_BLAS}}, - {"cublasGetMatrixAsync", {"hipblasGetMatrixAsync", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasSetMatrixAsync", {"hipblasSetMatrixAsync", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSetMatrix", {"hipblasSetMatrix", CONV_MATH_FUNC, API_BLAS}}, + {"cublasGetMatrix", {"hipblasGetMatrix", CONV_MATH_FUNC, API_BLAS}}, + {"cublasGetMatrixAsync", {"hipblasGetMatrixAsync", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSetMatrixAsync", {"hipblasSetMatrixAsync", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasXerbla", {"hipblasXerbla", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasXerbla", {"hipblasXerbla", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // NRM2 - {"cublasSnrm2", {"hipblasSnrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDnrm2", {"hipblasDnrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSnrm2", {"hipblasSnrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDnrm2", {"hipblasDnrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, {"cublasScnrm2", {"hipblasScnrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, {"cublasDznrm2", {"hipblasDznrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, {"cublasNrm2Ex", {"hipblasNrm2Ex", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // DOT - {"cublasSdot", {"hipblasSdot", CONV_MATH_FUNC, API_BLAS}}, + {"cublasSdot", {"hipblasSdot", CONV_MATH_FUNC, API_BLAS}}, // there is no such a function in CUDA {"cublasSdotBatched", {"hipblasSdotBatched", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDdot", {"hipblasDdot", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDdot", {"hipblasDdot", CONV_MATH_FUNC, API_BLAS}}, // there is no such a function in CUDA {"cublasDdotBatched", {"hipblasDdotBatched", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCdotu", {"hipblasCdotu", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCdotc", {"hipblasCdotc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZdotu", {"hipblasZdotu", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZdotc", {"hipblasZdotc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCdotu", {"hipblasCdotu", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCdotc", {"hipblasCdotc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZdotu", {"hipblasZdotu", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZdotc", {"hipblasZdotc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SCAL - {"cublasSscal", {"hipblasSscal", CONV_MATH_FUNC, API_BLAS}}, + {"cublasSscal", {"hipblasSscal", CONV_MATH_FUNC, API_BLAS}}, // there is no such a function in CUDA {"cublasSscalBatched", {"hipblasSscalBatched", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDscal", {"hipblasDscal", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDscal", {"hipblasDscal", CONV_MATH_FUNC, API_BLAS}}, // there is no such a function in CUDA {"cublasDscalBatched", {"hipblasDscalBatched", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCscal", {"hipblasCscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsscal", {"hipblasCsscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZscal", {"hipblasZscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZdscal", {"hipblasZdscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCscal", {"hipblasCscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsscal", {"hipblasCsscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZscal", {"hipblasZscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZdscal", {"hipblasZdscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // AXPY - {"cublasSaxpy", {"hipblasSaxpy", CONV_MATH_FUNC, API_BLAS}}, - {"cublasSaxpyBatched", {"hipblasSaxpyBatched", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDaxpy", {"hipblasDaxpy", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCaxpy", {"hipblasCaxpy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZaxpy", {"hipblasZaxpy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSaxpy", {"hipblasSaxpy", CONV_MATH_FUNC, API_BLAS}}, + {"cublasSaxpyBatched", {"hipblasSaxpyBatched", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDaxpy", {"hipblasDaxpy", CONV_MATH_FUNC, API_BLAS}}, + {"cublasCaxpy", {"hipblasCaxpy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZaxpy", {"hipblasZaxpy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // COPY - {"cublasScopy", {"hipblasScopy", CONV_MATH_FUNC, API_BLAS}}, + {"cublasScopy", {"hipblasScopy", CONV_MATH_FUNC, API_BLAS}}, // there is no such a function in CUDA - {"cublasScopyBatched", {"hipblasScopyBatched", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDcopy", {"hipblasDcopy", CONV_MATH_FUNC, API_BLAS}}, + {"cublasScopyBatched", {"hipblasScopyBatched", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDcopy", {"hipblasDcopy", CONV_MATH_FUNC, API_BLAS}}, // there is no such a function in CUDA - {"cublasDcopyBatched", {"hipblasDcopyBatched", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCcopy", {"hipblasCcopy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZcopy", {"hipblasZcopy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDcopyBatched", {"hipblasDcopyBatched", CONV_MATH_FUNC, API_BLAS}}, + {"cublasCcopy", {"hipblasCcopy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZcopy", {"hipblasZcopy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SWAP - {"cublasSswap", {"hipblasSswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDswap", {"hipblasDswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCswap", {"hipblasCswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZswap", {"hipblasZswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSswap", {"hipblasSswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDswap", {"hipblasDswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCswap", {"hipblasCswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZswap", {"hipblasZswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // AMAX - {"cublasIsamax", {"hipblasIsamax", CONV_MATH_FUNC, API_BLAS}}, - {"cublasIdamax", {"hipblasIdamax", CONV_MATH_FUNC, API_BLAS}}, - {"cublasIcamax", {"hipblasIcamax", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasIzamax", {"hipblasIzamax", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasIsamax", {"hipblasIsamax", CONV_MATH_FUNC, API_BLAS}}, + {"cublasIdamax", {"hipblasIdamax", CONV_MATH_FUNC, API_BLAS}}, + {"cublasIcamax", {"hipblasIcamax", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasIzamax", {"hipblasIzamax", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // AMIN - {"cublasIsamin", {"hipblasIsamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasIdamin", {"hipblasIdamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasIcamin", {"hipblasIcamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasIzamin", {"hipblasIzamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasIsamin", {"hipblasIsamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasIdamin", {"hipblasIdamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasIcamin", {"hipblasIcamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasIzamin", {"hipblasIzamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // ASUM - {"cublasSasum", {"hipblasSasum", CONV_MATH_FUNC, API_BLAS}}, + {"cublasSasum", {"hipblasSasum", CONV_MATH_FUNC, API_BLAS}}, // there is no such a function in CUDA - {"cublasSasumBatched", {"hipblasSasumBatched", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDasum", {"hipblasDasum", CONV_MATH_FUNC, API_BLAS}}, + {"cublasSasumBatched", {"hipblasSasumBatched", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDasum", {"hipblasDasum", CONV_MATH_FUNC, API_BLAS}}, // there is no such a function in CUDA - {"cublasDasumBatched", {"hipblasDasumBatched", CONV_MATH_FUNC, API_BLAS}}, - {"cublasScasum", {"hipblasScasum", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDzasum", {"hipblasDzasum", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDasumBatched", {"hipblasDasumBatched", CONV_MATH_FUNC, API_BLAS}}, + {"cublasScasum", {"hipblasScasum", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDzasum", {"hipblasDzasum", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // ROT - {"cublasSrot", {"hipblasSrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDrot", {"hipblasDrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCrot", {"hipblasCrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsrot", {"hipblasCsrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZrot", {"hipblasZrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZdrot", {"hipblasZdrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSrot", {"hipblasSrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDrot", {"hipblasDrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCrot", {"hipblasCrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsrot", {"hipblasCsrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZrot", {"hipblasZrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZdrot", {"hipblasZdrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // ROTG - {"cublasSrotg", {"hipblasSrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDrotg", {"hipblasDrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCrotg", {"hipblasCrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZrotg", {"hipblasZrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSrotg", {"hipblasSrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDrotg", {"hipblasDrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCrotg", {"hipblasCrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZrotg", {"hipblasZrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // ROTM - {"cublasSrotm", {"hipblasSrotm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDrotm", {"hipblasDrotm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSrotm", {"hipblasSrotm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDrotm", {"hipblasDrotm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // ROTMG - {"cublasSrotmg", {"hipblasSrotmg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDrotmg", {"hipblasDrotmg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSrotmg", {"hipblasSrotmg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDrotmg", {"hipblasDrotmg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // GEMV - {"cublasSgemv", {"hipblasSgemv", CONV_MATH_FUNC, API_BLAS}}, + {"cublasSgemv", {"hipblasSgemv", CONV_MATH_FUNC, API_BLAS}}, // there is no such a function in CUDA - {"cublasSgemvBatched", {"hipblasSgemvBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDgemv", {"hipblasDgemv", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCgemv", {"hipblasCgemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgemv", {"hipblasZgemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSgemvBatched", {"hipblasSgemvBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDgemv", {"hipblasDgemv", CONV_MATH_FUNC, API_BLAS}}, + {"cublasCgemv", {"hipblasCgemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgemv", {"hipblasZgemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // GBMV - {"cublasSgbmv", {"hipblasSgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDgbmv", {"hipblasDgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgbmv", {"hipblasCgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgbmv", {"hipblasZgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSgbmv", {"hipblasSgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDgbmv", {"hipblasDgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgbmv", {"hipblasCgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgbmv", {"hipblasZgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TRMV - {"cublasStrmv", {"hipblasStrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtrmv", {"hipblasDtrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtrmv", {"hipblasCtrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtrmv", {"hipblasZtrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStrmv", {"hipblasStrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtrmv", {"hipblasDtrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtrmv", {"hipblasCtrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtrmv", {"hipblasZtrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TBMV - {"cublasStbmv", {"hipblasStbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtbmv", {"hipblasDtbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtbmv", {"hipblasCtbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtbmv", {"hipblasZtbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStbmv", {"hipblasStbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtbmv", {"hipblasDtbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtbmv", {"hipblasCtbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtbmv", {"hipblasZtbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TPMV - {"cublasStpmv", {"hipblasStpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtpmv", {"hipblasDtpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtpmv", {"hipblasCtpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtpmv", {"hipblasZtpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStpmv", {"hipblasStpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtpmv", {"hipblasDtpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtpmv", {"hipblasCtpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtpmv", {"hipblasZtpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TRSV - {"cublasStrsv", {"hipblasStrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtrsv", {"hipblasDtrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtrsv", {"hipblasCtrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtrsv", {"hipblasZtrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStrsv", {"hipblasStrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtrsv", {"hipblasDtrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtrsv", {"hipblasCtrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtrsv", {"hipblasZtrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TPSV - {"cublasStpsv", {"hipblasStpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtpsv", {"hipblasDtpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtpsv", {"hipblasCtpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtpsv", {"hipblasZtpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStpsv", {"hipblasStpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtpsv", {"hipblasDtpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtpsv", {"hipblasCtpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtpsv", {"hipblasZtpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TBSV - {"cublasStbsv", {"hipblasStbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtbsv", {"hipblasDtbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtbsv", {"hipblasCtbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtbsv", {"hipblasZtbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStbsv", {"hipblasStbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtbsv", {"hipblasDtbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtbsv", {"hipblasCtbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtbsv", {"hipblasZtbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYMV/HEMV - {"cublasSsymv", {"hipblasSsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsymv", {"hipblasDsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsymv", {"hipblasCsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZsymv", {"hipblasZsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasChemv", {"hipblasChemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZhemv", {"hipblasZhemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsymv", {"hipblasSsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsymv", {"hipblasDsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsymv", {"hipblasCsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZsymv", {"hipblasZsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasChemv", {"hipblasChemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZhemv", {"hipblasZhemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SBMV/HBMV - {"cublasSsbmv", {"hipblasSsbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsbmv", {"hpiblasDsbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasChbmv", {"hipblasChbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZhbmv", {"hipblasZhbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsbmv", {"hipblasSsbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsbmv", {"hpiblasDsbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasChbmv", {"hipblasChbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZhbmv", {"hipblasZhbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SPMV/HPMV - {"cublasSspmv", {"hipblasSspmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDspmv", {"hipblasDspmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasChpmv", {"hipblasChpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZhpmv", {"hipblasZhpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSspmv", {"hipblasSspmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDspmv", {"hipblasDspmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasChpmv", {"hipblasChpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZhpmv", {"hipblasZhpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // GER - {"cublasSger", {"hipblasSger", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDger", {"hipblasDger", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCgeru", {"hipblasCgeru", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgerc", {"hipblasCgerc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgeru", {"hipblasZgeru", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgerc", {"hipblasZgerc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSger", {"hipblasSger", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDger", {"hipblasDger", CONV_MATH_FUNC, API_BLAS}}, + {"cublasCgeru", {"hipblasCgeru", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgerc", {"hipblasCgerc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgeru", {"hipblasZgeru", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgerc", {"hipblasZgerc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYR/HER - {"cublasSsyr", {"hipblasSsyr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsyr", {"hipblasDsyr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCher", {"hipblasCher", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZher", {"hipblasZher", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsyr", {"hipblasSsyr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsyr", {"hipblasDsyr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCher", {"hipblasCher", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZher", {"hipblasZher", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SPR/HPR - {"cublasSspr", {"hipblasSspr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDspr", {"hipblasDspr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasChpr", {"hipblasChpr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZhpr", {"hipblasZhpr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSspr", {"hipblasSspr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDspr", {"hipblasDspr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasChpr", {"hipblasChpr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZhpr", {"hipblasZhpr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYR2/HER2 - {"cublasSsyr2", {"hipblasSsyr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsyr2", {"hipblasDsyr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCher2", {"hipblasCher2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZher2", {"hipblasZher2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsyr2", {"hipblasSsyr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsyr2", {"hipblasDsyr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCher2", {"hipblasCher2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZher2", {"hipblasZher2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SPR2/HPR2 - {"cublasSspr2", {"hipblasSspr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDspr2", {"hipblasDspr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasChpr2", {"hipblasChpr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZhpr2", {"hipblasZhpr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSspr2", {"hipblasSspr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDspr2", {"hipblasDspr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasChpr2", {"hipblasChpr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZhpr2", {"hipblasZhpr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // Blas3 (v1) Routines // GEMM - {"cublasSgemm", {"hipblasSgemm", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDgemm", {"hipblasDgemm", CONV_MATH_FUNC, API_BLAS}}, + {"cublasSgemm", {"hipblasSgemm", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDgemm", {"hipblasDgemm", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCgemm", {"hipblasCgemm", CONV_MATH_FUNC, API_BLAS}}, - {"cublasZgemm", {"hipblasZgemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasHgemm", {"hipblasHgemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgemm", {"hipblasCgemm", CONV_MATH_FUNC, API_BLAS}}, + {"cublasZgemm", {"hipblasZgemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasHgemm", {"hipblasHgemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // BATCH GEMM - {"cublasSgemmBatched", {"hipblasSgemmBatched", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDgemmBatched", {"hipblasDgemmBatched", CONV_MATH_FUNC, API_BLAS}}, - {"cublasHgemmBatched", {"hipblasHgemmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSgemmBatched", {"hipblasSgemmBatched", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDgemmBatched", {"hipblasDgemmBatched", CONV_MATH_FUNC, API_BLAS}}, + {"cublasHgemmBatched", {"hipblasHgemmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasSgemmStridedBatched", {"hipblasSgemmStridedBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDgemmStridedBatched", {"hipblasDgemmStridedBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSgemmStridedBatched", + {"hipblasSgemmStridedBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDgemmStridedBatched", + {"hipblasDgemmStridedBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgemmBatched", {"hipblasCgemmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgemm3mBatched", {"hipblasCgemm3mBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgemmBatched", {"hipblasZgemmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgemmBatched", {"hipblasCgemmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgemm3mBatched", {"hipblasCgemm3mBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgemmBatched", {"hipblasZgemmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgemmStridedBatched", {"hipblasCgemmStridedBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgemm3mStridedBatched", {"hipblasCgemm3mStridedBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgemmStridedBatched", {"hipblasZgemmStridedBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasHgemmStridedBatched", {"hipblasHgemmStridedBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgemmStridedBatched", + {"hipblasCgemmStridedBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgemm3mStridedBatched", + {"hipblasCgemm3mStridedBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgemmStridedBatched", + {"hipblasZgemmStridedBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasHgemmStridedBatched", + {"hipblasHgemmStridedBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYRK - {"cublasSsyrk", {"hipblasSsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsyrk", {"hipblasDsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsyrk", {"hipblasCsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZsyrk", {"hipblasZsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsyrk", {"hipblasSsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsyrk", {"hipblasDsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsyrk", {"hipblasCsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZsyrk", {"hipblasZsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // HERK - {"cublasCherk", {"hipblasCherk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZherk", {"hipblasZherk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCherk", {"hipblasCherk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZherk", {"hipblasZherk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYR2K - {"cublasSsyr2k", {"hipblasSsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsyr2k", {"hipblasDsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsyr2k", {"hipblasCsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZsyr2k", {"hipblasZsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsyr2k", {"hipblasSsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsyr2k", {"hipblasDsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsyr2k", {"hipblasCsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZsyr2k", {"hipblasZsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYRKX - eXtended SYRK - {"cublasSsyrkx", {"hipblasSsyrkx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsyrkx", {"hipblasDsyrkx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsyrkx", {"hipblasCsyrkx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZsyrkx", {"hipblasZsyrkx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsyrkx", {"hipblasSsyrkx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsyrkx", {"hipblasDsyrkx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsyrkx", {"hipblasCsyrkx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZsyrkx", {"hipblasZsyrkx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // HER2K - {"cublasCher2k", {"hipblasCher2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZher2k", {"hipblasZher2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCher2k", {"hipblasCher2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZher2k", {"hipblasZher2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // HERKX - eXtended HERK - {"cublasCherkx", {"hipblasCherkx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZherkx", {"hipblasZherkx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCherkx", {"hipblasCherkx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZherkx", {"hipblasZherkx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYMM - {"cublasSsymm", {"hipblasSsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsymm", {"hipblasDsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsymm", {"hipblasCsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZsymm", {"hipblasZsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsymm", {"hipblasSsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsymm", {"hipblasDsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsymm", {"hipblasCsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZsymm", {"hipblasZsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // HEMM - {"cublasChemm", {"hipblasChemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZhemm", {"hipblasZhemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasChemm", {"hipblasChemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZhemm", {"hipblasZhemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TRSM - {"cublasStrsm", {"hipblasStrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtrsm", {"hipblasDtrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtrsm", {"hipblasCtrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtrsm", {"hipblasZtrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStrsm", {"hipblasStrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtrsm", {"hipblasDtrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtrsm", {"hipblasCtrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtrsm", {"hipblasZtrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TRSM - Batched Triangular Solver - {"cublasStrsmBatched", {"hipblasStrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtrsmBatched", {"hipblasDtrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtrsmBatched", {"hipblasCtrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtrsmBatched", {"hipblasZtrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStrsmBatched", {"hipblasStrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtrsmBatched", {"hipblasDtrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtrsmBatched", {"hipblasCtrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtrsmBatched", {"hipblasZtrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TRMM - {"cublasStrmm", {"hipblasStrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtrmm", {"hipblasDtrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtrmm", {"hipblasCtrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtrmm", {"hipblasZtrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStrmm", {"hipblasStrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtrmm", {"hipblasDtrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtrmm", {"hipblasCtrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtrmm", {"hipblasZtrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // ------------------------ CUBLAS BLAS - like extension (cublas_api.h) // GEAM - {"cublasSgeam", {"hipblasSgeam", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDgeam", {"hipblasDgeam", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCgeam", {"hipblasCgeam", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgeam", {"hipblasZgeam", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSgeam", {"hipblasSgeam", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDgeam", {"hipblasDgeam", CONV_MATH_FUNC, API_BLAS}}, + {"cublasCgeam", {"hipblasCgeam", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgeam", {"hipblasZgeam", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // GETRF - Batched LU - {"cublasSgetrfBatched", {"hipblasSgetrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDgetrfBatched", {"hipblasDgetrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgetrfBatched", {"hipblasCgetrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgetrfBatched", {"hipblasZgetrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSgetrfBatched", {"hipblasSgetrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDgetrfBatched", {"hipblasDgetrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgetrfBatched", {"hipblasCgetrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgetrfBatched", {"hipblasZgetrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // Batched inversion based on LU factorization from getrf - {"cublasSgetriBatched", {"hipblasSgetriBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDgetriBatched", {"hipblasDgetriBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgetriBatched", {"hipblasCgetriBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgetriBatched", {"hipblasZgetriBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSgetriBatched", {"hipblasSgetriBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDgetriBatched", {"hipblasDgetriBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgetriBatched", {"hipblasCgetriBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgetriBatched", {"hipblasZgetriBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // Batched solver based on LU factorization from getrf - {"cublasSgetrsBatched", {"hipblasSgetrsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDgetrsBatched", {"hipblasDgetrsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgetrsBatched", {"hipblasCgetrsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgetrsBatched", {"hipblasZgetrsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSgetrsBatched", {"hipblasSgetrsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDgetrsBatched", {"hipblasDgetrsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgetrsBatched", {"hipblasCgetrsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgetrsBatched", {"hipblasZgetrsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TRSM - Batched Triangular Solver - {"cublasStrsmBatched", {"hipblasStrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtrsmBatched", {"hipblasDtrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtrsmBatched", {"hipblasCtrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtrsmBatched", {"hipblasZtrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStrsmBatched", {"hipblasStrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtrsmBatched", {"hipblasDtrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtrsmBatched", {"hipblasCtrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtrsmBatched", {"hipblasZtrsmBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // MATINV - Batched - {"cublasSmatinvBatched", {"hipblasSmatinvBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDmatinvBatched", {"hipblasDmatinvBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCmatinvBatched", {"hipblasCmatinvBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZmatinvBatched", {"hipblasZmatinvBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSmatinvBatched", {"hipblasSmatinvBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDmatinvBatched", {"hipblasDmatinvBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCmatinvBatched", {"hipblasCmatinvBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZmatinvBatched", {"hipblasZmatinvBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // Batch QR Factorization - {"cublasSgeqrfBatched", {"hipblasSgeqrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDgeqrfBatched", {"hipblasDgeqrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgeqrfBatched", {"hipblasCgeqrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgeqrfBatched", {"hipblasZgeqrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSgeqrfBatched", {"hipblasSgeqrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDgeqrfBatched", {"hipblasDgeqrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgeqrfBatched", {"hipblasCgeqrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgeqrfBatched", {"hipblasZgeqrfBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // Least Square Min only m >= n and Non-transpose supported - {"cublasSgelsBatched", {"hipblasSgelsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDgelsBatched", {"hipblasDgelsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgelsBatched", {"hipblasCgelsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgelsBatched", {"hipblasZgelsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSgelsBatched", {"hipblasSgelsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDgelsBatched", {"hipblasDgelsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgelsBatched", {"hipblasCgelsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgelsBatched", {"hipblasZgelsBatched", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // DGMM - {"cublasSdgmm", {"hipblasSdgmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDdgmm", {"hipblasDdgmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCdgmm", {"hipblasCdgmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZdgmm", {"hipblasZdgmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSdgmm", {"hipblasSdgmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDdgmm", {"hipblasDdgmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCdgmm", {"hipblasCdgmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZdgmm", {"hipblasZdgmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TPTTR - Triangular Pack format to Triangular format - {"cublasStpttr", {"hipblasStpttr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtpttr", {"hipblasDtpttr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtpttr", {"hipblasCtpttr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtpttr", {"hipblasZtpttr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStpttr", {"hipblasStpttr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtpttr", {"hipblasDtpttr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtpttr", {"hipblasCtpttr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtpttr", {"hipblasZtpttr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TRTTP - Triangular format to Triangular Pack format - {"cublasStrttp", {"hipblasStrttp", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtrttp", {"hipblasDtrttp", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtrttp", {"hipblasCtrttp", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtrttp", {"hipblasZtrttp", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStrttp", {"hipblasStrttp", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtrttp", {"hipblasDtrttp", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtrttp", {"hipblasCtrttp", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtrttp", {"hipblasZtrttp", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // Blas2 (v2) Routines - {"cublasCreate_v2", {"hipblasCreate", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDestroy_v2", {"hipblasDestroy", CONV_MATH_FUNC, API_BLAS}}, + {"cublasCreate_v2", {"hipblasCreate", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDestroy_v2", {"hipblasDestroy", CONV_MATH_FUNC, API_BLAS}}, - {"cublasGetVersion_v2", {"hipblasGetVersion", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasSetStream_v2", {"hipblasSetStream", CONV_MATH_FUNC, API_BLAS}}, - {"cublasGetStream_v2", {"hipblasGetStream", CONV_MATH_FUNC, API_BLAS}}, - {"cublasGetPointerMode_v2", {"hipblasGetPointerMode", CONV_MATH_FUNC, API_BLAS}}, - {"cublasSetPointerMode_v2", {"hipblasSetPointerMode", CONV_MATH_FUNC, API_BLAS}}, + {"cublasGetVersion_v2", {"hipblasGetVersion", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSetStream_v2", {"hipblasSetStream", CONV_MATH_FUNC, API_BLAS}}, + {"cublasGetStream_v2", {"hipblasGetStream", CONV_MATH_FUNC, API_BLAS}}, + {"cublasGetPointerMode_v2", {"hipblasGetPointerMode", CONV_MATH_FUNC, API_BLAS}}, + {"cublasSetPointerMode_v2", {"hipblasSetPointerMode", CONV_MATH_FUNC, API_BLAS}}, // GEMV - {"cublasSgemv_v2", {"hipblasSgemv", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDgemv_v2", {"hipblasDgemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgemv_v2", {"hipblasCgemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgemv_v2", {"hipblasZgemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSgemv_v2", {"hipblasSgemv", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDgemv_v2", {"hipblasDgemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgemv_v2", {"hipblasCgemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgemv_v2", {"hipblasZgemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // GBMV - {"cublasSgbmv_v2", {"hipblasSgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDgbmv_v2", {"hipblasDgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgbmv_v2", {"hipblasCgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgbmv_v2", {"hipblasZgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSgbmv_v2", {"hipblasSgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDgbmv_v2", {"hipblasDgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgbmv_v2", {"hipblasCgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgbmv_v2", {"hipblasZgbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TRMV - {"cublasStrmv_v2", {"hipblasStrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtrmv_v2", {"hipblasDtrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtrmv_v2", {"hipblasCtrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtrmv_v2", {"hipblasZtrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStrmv_v2", {"hipblasStrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtrmv_v2", {"hipblasDtrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtrmv_v2", {"hipblasCtrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtrmv_v2", {"hipblasZtrmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TBMV - {"cublasStbmv_v2", {"hipblasStbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtbmv_v2", {"hipblasDtbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtbmv_v2", {"hipblasCtbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtbmv_v2", {"hipblasZtbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStbmv_v2", {"hipblasStbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtbmv_v2", {"hipblasDtbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtbmv_v2", {"hipblasCtbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtbmv_v2", {"hipblasZtbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TPMV - {"cublasStpmv_v2", {"hipblasStpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtpmv_v2", {"hipblasDtpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtpmv_v2", {"hipblasCtpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtpmv_v2", {"hipblasZtpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStpmv_v2", {"hipblasStpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtpmv_v2", {"hipblasDtpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtpmv_v2", {"hipblasCtpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtpmv_v2", {"hipblasZtpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TRSV - {"cublasStrsv_v2", {"hipblasStrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtrsv_v2", {"hipblasDtrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtrsv_v2", {"hipblasCtrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtrsv_v2", {"hipblasZtrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStrsv_v2", {"hipblasStrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtrsv_v2", {"hipblasDtrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtrsv_v2", {"hipblasCtrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtrsv_v2", {"hipblasZtrsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TPSV - {"cublasStpsv_v2", {"hipblasStpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtpsv_v2", {"hipblasDtpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtpsv_v2", {"hipblasCtpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtpsv_v2", {"hipblasZtpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStpsv_v2", {"hipblasStpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtpsv_v2", {"hipblasDtpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtpsv_v2", {"hipblasCtpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtpsv_v2", {"hipblasZtpsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TBSV - {"cublasStbsv_v2", {"hipblasStbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtbsv_v2", {"hipblasDtbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtbsv_v2", {"hipblasCtbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtbsv_v2", {"hipblasZtbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStbsv_v2", {"hipblasStbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtbsv_v2", {"hipblasDtbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtbsv_v2", {"hipblasCtbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtbsv_v2", {"hipblasZtbsv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYMV/HEMV - {"cublasSsymv_v2", {"hipblasSsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsymv_v2", {"hipblasDsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsymv_v2", {"hipblasCsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZsymv_v2", {"hipblasZsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasChemv_v2", {"hipblasChemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZhemv_v2", {"hipblasZhemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsymv_v2", {"hipblasSsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsymv_v2", {"hipblasDsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsymv_v2", {"hipblasCsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZsymv_v2", {"hipblasZsymv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasChemv_v2", {"hipblasChemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZhemv_v2", {"hipblasZhemv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SBMV/HBMV - {"cublasSsbmv_v2", {"hipblasSsbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsbmv_v2", {"hpiblasDsbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasChbmv_v2", {"hipblasChbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZhbmv_v2", {"hipblasZhbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsbmv_v2", {"hipblasSsbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsbmv_v2", {"hpiblasDsbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasChbmv_v2", {"hipblasChbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZhbmv_v2", {"hipblasZhbmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SPMV/HPMV - {"cublasSspmv_v2", {"hipblasSspmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDspmv_v2", {"hipblasDspmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasChpmv_v2", {"hipblasChpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZhpmv_v2", {"hipblasZhpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSspmv_v2", {"hipblasSspmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDspmv_v2", {"hipblasDspmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasChpmv_v2", {"hipblasChpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZhpmv_v2", {"hipblasZhpmv", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // GER - {"cublasSger_v2", {"hipblasSger", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDger_v2", {"hipblasDger", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCgeru_v2", {"hipblasCgeru", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgerc_v2", {"hipblasCgerc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgeru_v2", {"hipblasZgeru", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgerc_v2", {"hipblasZgerc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSger_v2", {"hipblasSger", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDger_v2", {"hipblasDger", CONV_MATH_FUNC, API_BLAS}}, + {"cublasCgeru_v2", {"hipblasCgeru", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgerc_v2", {"hipblasCgerc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgeru_v2", {"hipblasZgeru", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgerc_v2", {"hipblasZgerc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYR/HER - {"cublasSsyr_v2", {"hipblasSsyr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsyr_v2", {"hipblasDsyr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsyr_v2", {"hipblasCsyr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZsyr_v2", {"hipblasZsyr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCher_v2", {"hipblasCher", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZher_v2", {"hipblasZher", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsyr_v2", {"hipblasSsyr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsyr_v2", {"hipblasDsyr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsyr_v2", {"hipblasCsyr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZsyr_v2", {"hipblasZsyr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCher_v2", {"hipblasCher", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZher_v2", {"hipblasZher", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SPR/HPR - {"cublasSspr_v2", {"hipblasSspr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDspr_v2", {"hipblasDspr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasChpr_v2", {"hipblasChpr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZhpr_v2", {"hipblasZhpr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSspr_v2", {"hipblasSspr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDspr_v2", {"hipblasDspr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasChpr_v2", {"hipblasChpr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZhpr_v2", {"hipblasZhpr", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYR2/HER2 - {"cublasSsyr2_v2", {"hipblasSsyr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsyr2_v2", {"hipblasDsyr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsyr2_v2", {"hipblasCsyr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZsyr2_v2", {"hipblasZsyr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCher2_v2", {"hipblasCher2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZher2_v2", {"hipblasZher2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsyr2_v2", {"hipblasSsyr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsyr2_v2", {"hipblasDsyr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsyr2_v2", {"hipblasCsyr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZsyr2_v2", {"hipblasZsyr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCher2_v2", {"hipblasCher2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZher2_v2", {"hipblasZher2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SPR2/HPR2 - {"cublasSspr2_v2", {"hipblasSspr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDspr2_v2", {"hipblasDspr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasChpr2_v2", {"hipblasChpr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZhpr2_v2", {"hipblasZhpr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSspr2_v2", {"hipblasSspr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDspr2_v2", {"hipblasDspr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasChpr2_v2", {"hipblasChpr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZhpr2_v2", {"hipblasZhpr2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // Blas3 (v2) Routines // GEMM - {"cublasSgemm_v2", {"hipblasSgemm", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDgemm_v2", {"hipblasDgemm", CONV_MATH_FUNC, API_BLAS}}, + {"cublasSgemm_v2", {"hipblasSgemm", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDgemm_v2", {"hipblasDgemm", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCgemm_v2", {"hipblasCgemm", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCgemm3m", {"hipblasCgemm3m", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCgemm3mEx", {"hipblasCgemm3mEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgemm_v2", {"hipblasCgemm", CONV_MATH_FUNC, API_BLAS}}, + {"cublasCgemm3m", {"hipblasCgemm3m", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgemm3mEx", {"hipblasCgemm3mEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgemm_v2", {"hipblasZgemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZgemm3m", {"hipblasZgemm3m", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgemm_v2", {"hipblasZgemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZgemm3m", {"hipblasZgemm3m", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - //IO in FP16 / FP32, computation in float - {"cublasSgemmEx", {"hipblasSgemmEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasGemmEx", {"hipblasGemmEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + // IO in FP16 / FP32, computation in float + {"cublasSgemmEx", {"hipblasSgemmEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasGemmEx", {"hipblasGemmEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // IO in Int8 complex/cuComplex, computation in cuComplex - {"cublasCgemmEx", {"hipblasCgemmEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCgemmEx", {"hipblasCgemmEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasUint8gemmBias", {"hipblasUint8gemmBias", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasUint8gemmBias", {"hipblasUint8gemmBias", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYRK - {"cublasSsyrk_v2", {"hipblasSsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsyrk_v2", {"hipblasDsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsyrk_v2", {"hipblasCsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZsyrk_v2", {"hipblasZsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsyrk_v2", {"hipblasSsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsyrk_v2", {"hipblasDsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsyrk_v2", {"hipblasCsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZsyrk_v2", {"hipblasZsyrk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // IO in Int8 complex/cuComplex, computation in cuComplex - {"cublasCsyrkEx", {"hipblasCsyrkEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsyrkEx", {"hipblasCsyrkEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // IO in Int8 complex/cuComplex, computation in cuComplex, Gaussian math - {"cublasCsyrk3mEx", {"hipblasCsyrk3mEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsyrk3mEx", {"hipblasCsyrk3mEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // HERK - {"cublasCherk_v2", {"hipblasCherk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCherk_v2", {"hipblasCherk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // IO in Int8 complex/cuComplex, computation in cuComplex - {"cublasCherkEx", {"hipblasCherkEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCherkEx", {"hipblasCherkEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // IO in Int8 complex/cuComplex, computation in cuComplex, Gaussian math - {"cublasCherk3mEx", {"hipblasCherk3mEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZherk_v2", {"hipblasZherk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCherk3mEx", {"hipblasCherk3mEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZherk_v2", {"hipblasZherk", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYR2K - {"cublasSsyr2k_v2", {"hipblasSsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsyr2k_v2", {"hipblasDsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsyr2k_v2", {"hipblasCsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZsyr2k_v2", {"hipblasZsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsyr2k_v2", {"hipblasSsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsyr2k_v2", {"hipblasDsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsyr2k_v2", {"hipblasCsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZsyr2k_v2", {"hipblasZsyr2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // HER2K - {"cublasCher2k_v2", {"hipblasCher2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZher2k_v2", {"hipblasZher2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCher2k_v2", {"hipblasCher2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZher2k_v2", {"hipblasZher2k", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SYMM - {"cublasSsymm_v2", {"hipblasSsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDsymm_v2", {"hipblasDsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsymm_v2", {"hipblasCsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZsymm_v2", {"hipblasZsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSsymm_v2", {"hipblasSsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDsymm_v2", {"hipblasDsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsymm_v2", {"hipblasCsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZsymm_v2", {"hipblasZsymm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // HEMM - {"cublasChemm_v2", {"hipblasChemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZhemm_v2", {"hipblasZhemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasChemm_v2", {"hipblasChemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZhemm_v2", {"hipblasZhemm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TRSM - {"cublasStrsm_v2", {"hipblasStrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtrsm_v2", {"hipblasDtrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtrsm_v2", {"hipblasCtrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtrsm_v2", {"hipblasZtrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStrsm_v2", {"hipblasStrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtrsm_v2", {"hipblasDtrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtrsm_v2", {"hipblasCtrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtrsm_v2", {"hipblasZtrsm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // TRMM - {"cublasStrmm_v2", {"hipblasStrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDtrmm_v2", {"hipblasDtrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCtrmm_v2", {"hipblasCtrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZtrmm_v2", {"hipblasZtrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasStrmm_v2", {"hipblasStrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDtrmm_v2", {"hipblasDtrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCtrmm_v2", {"hipblasCtrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZtrmm_v2", {"hipblasZtrmm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // NRM2 - {"cublasSnrm2_v2", {"hipblasSnrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDnrm2_v2", {"hipblasDnrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasScnrm2_v2", {"hipblasScnrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDznrm2_v2", {"hipblasDznrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSnrm2_v2", {"hipblasSnrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDnrm2_v2", {"hipblasDnrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasScnrm2_v2", {"hipblasScnrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDznrm2_v2", {"hipblasDznrm2", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // DOT - {"cublasDotEx", {"hipblasDotEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDotcEx", {"hipblasDotcEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDotEx", {"hipblasDotEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDotcEx", {"hipblasDotcEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasSdot_v2", {"hipblasSdot", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDdot_v2", {"hipblasDdot", CONV_MATH_FUNC, API_BLAS}}, + {"cublasSdot_v2", {"hipblasSdot", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDdot_v2", {"hipblasDdot", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCdotu_v2", {"hipblasCdotu", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCdotc_v2", {"hipblasCdotc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZdotu_v2", {"hipblasZdotu", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZdotc_v2", {"hipblasZdotc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCdotu_v2", {"hipblasCdotu", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCdotc_v2", {"hipblasCdotc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZdotu_v2", {"hipblasZdotu", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZdotc_v2", {"hipblasZdotc", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SCAL - {"cublasScalEx", {"hipblasScalEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasSscal_v2", {"hipblasSscal", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDscal_v2", {"hipblasDscal", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCscal_v2", {"hipblasCscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsscal_v2", {"hipblasCsscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZscal_v2", {"hipblasZscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZdscal_v2", {"hipblasZdscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasScalEx", {"hipblasScalEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSscal_v2", {"hipblasSscal", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDscal_v2", {"hipblasDscal", CONV_MATH_FUNC, API_BLAS}}, + {"cublasCscal_v2", {"hipblasCscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsscal_v2", {"hipblasCsscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZscal_v2", {"hipblasZscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZdscal_v2", {"hipblasZdscal", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // AXPY - {"cublasAxpyEx", {"hipblasAxpyEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasSaxpy_v2", {"hipblasSaxpy", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDaxpy_v2", {"hipblasDaxpy", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCaxpy_v2", {"hipblasCaxpy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZaxpy_v2", {"hipblasZaxpy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasAxpyEx", {"hipblasAxpyEx", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSaxpy_v2", {"hipblasSaxpy", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDaxpy_v2", {"hipblasDaxpy", CONV_MATH_FUNC, API_BLAS}}, + {"cublasCaxpy_v2", {"hipblasCaxpy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZaxpy_v2", {"hipblasZaxpy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // COPY - {"cublasScopy_v2", {"hipblasScopy", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDcopy_v2", {"hipblasDcopy", CONV_MATH_FUNC, API_BLAS}}, - {"cublasCcopy_v2", {"hipblasCcopy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZcopy_v2", {"hipblasZcopy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasScopy_v2", {"hipblasScopy", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDcopy_v2", {"hipblasDcopy", CONV_MATH_FUNC, API_BLAS}}, + {"cublasCcopy_v2", {"hipblasCcopy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZcopy_v2", {"hipblasZcopy", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // SWAP - {"cublasSswap_v2", {"hipblasSswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDswap_v2", {"hipblasDswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCswap_v2", {"hipblasCswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZswap_v2", {"hipblasZswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSswap_v2", {"hipblasSswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDswap_v2", {"hipblasDswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCswap_v2", {"hipblasCswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZswap_v2", {"hipblasZswap", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // AMAX - {"cublasIsamax_v2", {"hipblasIsamax", CONV_MATH_FUNC, API_BLAS}}, - {"cublasIdamax_v2", {"hipblasIdamax", CONV_MATH_FUNC, API_BLAS}}, - {"cublasIcamax_v2", {"hipblasIcamax", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasIzamax_v2", {"hipblasIzamax", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasIsamax_v2", {"hipblasIsamax", CONV_MATH_FUNC, API_BLAS}}, + {"cublasIdamax_v2", {"hipblasIdamax", CONV_MATH_FUNC, API_BLAS}}, + {"cublasIcamax_v2", {"hipblasIcamax", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasIzamax_v2", {"hipblasIzamax", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // AMIN - {"cublasIsamin_v2", {"hipblasIsamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasIdamin_v2", {"hipblasIdamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasIcamin_v2", {"hipblasIcamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasIzamin_v2", {"hipblasIzamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasIsamin_v2", {"hipblasIsamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasIdamin_v2", {"hipblasIdamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasIcamin_v2", {"hipblasIcamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasIzamin_v2", {"hipblasIzamin", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // ASUM - {"cublasSasum_v2", {"hipblasSasum", CONV_MATH_FUNC, API_BLAS}}, - {"cublasDasum_v2", {"hipblasDasum", CONV_MATH_FUNC, API_BLAS}}, - {"cublasScasum_v2", {"hipblasScasum", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDzasum_v2", {"hipblasDzasum", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSasum_v2", {"hipblasSasum", CONV_MATH_FUNC, API_BLAS}}, + {"cublasDasum_v2", {"hipblasDasum", CONV_MATH_FUNC, API_BLAS}}, + {"cublasScasum_v2", {"hipblasScasum", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDzasum_v2", {"hipblasDzasum", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // ROT - {"cublasSrot_v2", {"hipblasSrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDrot_v2", {"hipblasDrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCrot_v2", {"hipblasCrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCsrot_v2", {"hipblasCsrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZrot_v2", {"hipblasZrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZdrot_v2", {"hipblasZdrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSrot_v2", {"hipblasSrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDrot_v2", {"hipblasDrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCrot_v2", {"hipblasCrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCsrot_v2", {"hipblasCsrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZrot_v2", {"hipblasZrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZdrot_v2", {"hipblasZdrot", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // ROTG - {"cublasSrotg_v2", {"hipblasSrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDrotg_v2", {"hipblasDrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasCrotg_v2", {"hipblasCrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasZrotg_v2", {"hipblasZrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSrotg_v2", {"hipblasSrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDrotg_v2", {"hipblasDrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasCrotg_v2", {"hipblasCrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasZrotg_v2", {"hipblasZrotg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // ROTM - {"cublasSrotm_v2", {"hipblasSrotm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDrotm_v2", {"hipblasDrotm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSrotm_v2", {"hipblasSrotm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDrotm_v2", {"hipblasDrotm", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, // ROTMG - {"cublasSrotmg_v2", {"hipblasSrotmg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, - {"cublasDrotmg_v2", {"hipblasDrotmg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasSrotmg_v2", {"hipblasSrotmg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, + {"cublasDrotmg_v2", {"hipblasDrotmg", CONV_MATH_FUNC, API_BLAS, HIP_UNSUPPORTED}}, ///////////////////////////// cuRAND ///////////////////////////// // RAND function call status types (enum curandStatus) - {"CURAND_STATUS_SUCCESS", {"HIPRAND_STATUS_SUCCESS", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_STATUS_VERSION_MISMATCH", {"HIPRAND_STATUS_VERSION_MISMATCH", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_STATUS_NOT_INITIALIZED", {"HIPRAND_STATUS_NOT_INITIALIZED", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_STATUS_ALLOCATION_FAILED", {"HIPRAND_STATUS_ALLOCATION_FAILED", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_STATUS_TYPE_ERROR", {"HIPRAND_STATUS_TYPE_ERROR", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_STATUS_OUT_OF_RANGE", {"HIPRAND_STATUS_OUT_OF_RANGE", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_STATUS_LENGTH_NOT_MULTIPLE", {"HIPRAND_STATUS_LENGTH_NOT_MULTIPLE", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_STATUS_DOUBLE_PRECISION_REQUIRED", {"HIPRAND_STATUS_DOUBLE_PRECISION_REQUIRED", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_STATUS_LAUNCH_FAILURE", {"HIPRAND_STATUS_LAUNCH_FAILURE", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_STATUS_PREEXISTING_FAILURE", {"HIPRAND_STATUS_PREEXISTING_FAILURE", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_STATUS_INITIALIZATION_FAILED", {"HIPRAND_STATUS_INITIALIZATION_FAILED", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_STATUS_ARCH_MISMATCH", {"HIPRAND_STATUS_ARCH_MISMATCH", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_STATUS_INTERNAL_ERROR", {"HIPRAND_STATUS_INTERNAL_ERROR", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_SUCCESS", {"HIPRAND_STATUS_SUCCESS", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_VERSION_MISMATCH", + {"HIPRAND_STATUS_VERSION_MISMATCH", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_NOT_INITIALIZED", + {"HIPRAND_STATUS_NOT_INITIALIZED", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_ALLOCATION_FAILED", + {"HIPRAND_STATUS_ALLOCATION_FAILED", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_TYPE_ERROR", {"HIPRAND_STATUS_TYPE_ERROR", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_OUT_OF_RANGE", {"HIPRAND_STATUS_OUT_OF_RANGE", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_LENGTH_NOT_MULTIPLE", + {"HIPRAND_STATUS_LENGTH_NOT_MULTIPLE", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_DOUBLE_PRECISION_REQUIRED", + {"HIPRAND_STATUS_DOUBLE_PRECISION_REQUIRED", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_LAUNCH_FAILURE", + {"HIPRAND_STATUS_LAUNCH_FAILURE", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_PREEXISTING_FAILURE", + {"HIPRAND_STATUS_PREEXISTING_FAILURE", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_INITIALIZATION_FAILED", + {"HIPRAND_STATUS_INITIALIZATION_FAILED", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_ARCH_MISMATCH", + {"HIPRAND_STATUS_ARCH_MISMATCH", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_STATUS_INTERNAL_ERROR", + {"HIPRAND_STATUS_INTERNAL_ERROR", CONV_NUMERIC_LITERAL, API_RAND}}, // RAND generator types (enum curandRngType) - {"CURAND_RNG_TEST", {"HIPRAND_RNG_TEST", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_RNG_PSEUDO_DEFAULT", {"HIPRAND_RNG_PSEUDO_DEFAULT", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_RNG_PSEUDO_XORWOW", {"HIPRAND_RNG_PSEUDO_XORWOW", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_RNG_PSEUDO_MRG32K3A", {"HIPRAND_RNG_PSEUDO_MRG32K3A", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_RNG_PSEUDO_MTGP32", {"HIPRAND_RNG_PSEUDO_MTGP32", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_RNG_PSEUDO_MT19937", {"HIPRAND_RNG_PSEUDO_MT19937", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_RNG_PSEUDO_PHILOX4_32_10", {"HIPRAND_RNG_PSEUDO_PHILOX4_32_10", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_RNG_QUASI_DEFAULT", {"HIPRAND_RNG_QUASI_DEFAULT", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_RNG_QUASI_SOBOL32", {"HIPRAND_RNG_QUASI_SOBOL32", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_RNG_QUASI_SCRAMBLED_SOBOL32", {"HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_RNG_QUASI_SOBOL64", {"HIPRAND_RNG_QUASI_SOBOL64", CONV_NUMERIC_LITERAL, API_RAND}}, - {"CURAND_RNG_QUASI_SCRAMBLED_SOBOL64", {"HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_RNG_TEST", {"HIPRAND_RNG_TEST", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_RNG_PSEUDO_DEFAULT", {"HIPRAND_RNG_PSEUDO_DEFAULT", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_RNG_PSEUDO_XORWOW", {"HIPRAND_RNG_PSEUDO_XORWOW", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_RNG_PSEUDO_MRG32K3A", {"HIPRAND_RNG_PSEUDO_MRG32K3A", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_RNG_PSEUDO_MTGP32", {"HIPRAND_RNG_PSEUDO_MTGP32", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_RNG_PSEUDO_MT19937", {"HIPRAND_RNG_PSEUDO_MT19937", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_RNG_PSEUDO_PHILOX4_32_10", + {"HIPRAND_RNG_PSEUDO_PHILOX4_32_10", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_RNG_QUASI_DEFAULT", {"HIPRAND_RNG_QUASI_DEFAULT", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_RNG_QUASI_SOBOL32", {"HIPRAND_RNG_QUASI_SOBOL32", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_RNG_QUASI_SCRAMBLED_SOBOL32", + {"HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_RNG_QUASI_SOBOL64", {"HIPRAND_RNG_QUASI_SOBOL64", CONV_NUMERIC_LITERAL, API_RAND}}, + {"CURAND_RNG_QUASI_SCRAMBLED_SOBOL64", + {"HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64", CONV_NUMERIC_LITERAL, API_RAND}}, // RAND ordering of results in memory (enum curandOrdering) - {"CURAND_ORDERING_PSEUDO_BEST", {"HIPRAND_ORDERING_PSEUDO_BEST", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_ORDERING_PSEUDO_DEFAULT", {"HIPRAND_ORDERING_PSEUDO_DEFAULT", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_ORDERING_PSEUDO_SEEDED", {"HIPRAND_ORDERING_PSEUDO_SEEDED", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_ORDERING_QUASI_DEFAULT", {"HIPRAND_ORDERING_QUASI_DEFAULT", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_ORDERING_PSEUDO_BEST", + {"HIPRAND_ORDERING_PSEUDO_BEST", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_ORDERING_PSEUDO_DEFAULT", + {"HIPRAND_ORDERING_PSEUDO_DEFAULT", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_ORDERING_PSEUDO_SEEDED", + {"HIPRAND_ORDERING_PSEUDO_SEEDED", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_ORDERING_QUASI_DEFAULT", + {"HIPRAND_ORDERING_QUASI_DEFAULT", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, // RAND choice of direction vector set (enum curandDirectionVectorSet) - {"CURAND_DIRECTION_VECTORS_32_JOEKUO6", {"HIPRAND_DIRECTION_VECTORS_32_JOEKUO6", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6", {"HIPRAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_DIRECTION_VECTORS_64_JOEKUO6", {"HIPRAND_DIRECTION_VECTORS_64_JOEKUO6", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6", {"HIPRAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_DIRECTION_VECTORS_32_JOEKUO6", + {"HIPRAND_DIRECTION_VECTORS_32_JOEKUO6", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6", + {"HIPRAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6", CONV_NUMERIC_LITERAL, API_RAND, + HIP_UNSUPPORTED}}, + {"CURAND_DIRECTION_VECTORS_64_JOEKUO6", + {"HIPRAND_DIRECTION_VECTORS_64_JOEKUO6", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6", + {"HIPRAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6", CONV_NUMERIC_LITERAL, API_RAND, + HIP_UNSUPPORTED}}, // RAND method (enum curandMethod) - {"CURAND_CHOOSE_BEST", {"HIPRAND_CHOOSE_BEST", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_ITR", {"HIPRAND_ITR", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_KNUTH", {"HIPRAND_KNUTH", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_HITR", {"HIPRAND_HITR", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_M1", {"HIPRAND_M1", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_M2", {"HIPRAND_M2", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_BINARY_SEARCH", {"HIPRAND_BINARY_SEARCH", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_DISCRETE_GAUSS", {"HIPRAND_DISCRETE_GAUSS", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_REJECTION", {"HIPRAND_REJECTION", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_DEVICE_API", {"HIPRAND_DEVICE_API", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_FAST_REJECTION", {"HIPRAND_FAST_REJECTION", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_3RD", {"HIPRAND_3RD", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_DEFINITION", {"HIPRAND_DEFINITION", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, - {"CURAND_POISSON", {"HIPRAND_POISSON", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_CHOOSE_BEST", + {"HIPRAND_CHOOSE_BEST", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_ITR", {"HIPRAND_ITR", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_KNUTH", {"HIPRAND_KNUTH", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_HITR", {"HIPRAND_HITR", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_M1", {"HIPRAND_M1", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_M2", {"HIPRAND_M2", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_BINARY_SEARCH", + {"HIPRAND_BINARY_SEARCH", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_DISCRETE_GAUSS", + {"HIPRAND_DISCRETE_GAUSS", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_REJECTION", {"HIPRAND_REJECTION", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_DEVICE_API", {"HIPRAND_DEVICE_API", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_FAST_REJECTION", + {"HIPRAND_FAST_REJECTION", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_3RD", {"HIPRAND_3RD", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_DEFINITION", {"HIPRAND_DEFINITION", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_POISSON", {"HIPRAND_POISSON", CONV_NUMERIC_LITERAL, API_RAND, HIP_UNSUPPORTED}}, // RAND Host functions - {"curandCreateGenerator", {"hiprandCreateGenerator", CONV_MATH_FUNC, API_RAND}}, - {"curandCreateGeneratorHost", {"hiprandCreateGeneratorHost", CONV_MATH_FUNC, API_RAND}}, - {"curandCreatePoissonDistribution", {"hiprandCreatePoissonDistribution", CONV_MATH_FUNC, API_RAND}}, - {"curandDestroyDistribution", {"hiprandDestroyDistribution", CONV_MATH_FUNC, API_RAND}}, - {"curandDestroyGenerator", {"hiprandDestroyGenerator", CONV_MATH_FUNC, API_RAND}}, - {"curandGenerate", {"hiprandGenerate", CONV_MATH_FUNC, API_RAND}}, - {"curandGenerateLogNormal", {"hiprandGenerateLogNormal", CONV_MATH_FUNC, API_RAND}}, - {"curandGenerateLogNormalDouble", {"hiprandGenerateLogNormalDouble", CONV_MATH_FUNC, API_RAND}}, - {"curandGenerateLongLong", {"hiprandGenerateLongLong", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, - {"curandGenerateNormal", {"hiprandGenerateNormal", CONV_MATH_FUNC, API_RAND}}, - {"curandGenerateNormalDouble", {"hiprandGenerateNormalDouble", CONV_MATH_FUNC, API_RAND}}, - {"curandGeneratePoisson", {"hiprandGeneratePoisson", CONV_MATH_FUNC, API_RAND}}, - {"curandGenerateSeeds", {"hiprandGenerateSeeds", CONV_MATH_FUNC, API_RAND}}, - {"curandGenerateUniform", {"hiprandGenerateUniform", CONV_MATH_FUNC, API_RAND}}, - {"curandGenerateUniformDouble", {"hiprandGenerateUniformDouble", CONV_MATH_FUNC, API_RAND}}, - {"curandGetDirectionVectors32", {"hiprandGetDirectionVectors32", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, - {"curandGetDirectionVectors64", {"hiprandGetDirectionVectors64", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, - {"curandGetProperty", {"hiprandGetProperty", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, - {"curandGetScrambleConstants32", {"hiprandGetScrambleConstants32", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, - {"curandGetScrambleConstants64", {"hiprandGetScrambleConstants64", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, - {"curandGetVersion", {"hiprandGetVersion", CONV_MATH_FUNC, API_RAND}}, - {"curandSetGeneratorOffset", {"hiprandSetGeneratorOffset", CONV_MATH_FUNC, API_RAND}}, - {"curandSetGeneratorOrdering", {"hiprandSetGeneratorOrdering", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, - {"curandSetPseudoRandomGeneratorSeed", {"hiprandSetPseudoRandomGeneratorSeed", CONV_MATH_FUNC, API_RAND}}, - {"curandSetQuasiRandomGeneratorDimensions", {"hiprandSetQuasiRandomGeneratorDimensions", CONV_MATH_FUNC, API_RAND}}, - {"curandSetStream", {"hiprandSetStream", CONV_MATH_FUNC, API_RAND}}, + {"curandCreateGenerator", {"hiprandCreateGenerator", CONV_MATH_FUNC, API_RAND}}, + {"curandCreateGeneratorHost", {"hiprandCreateGeneratorHost", CONV_MATH_FUNC, API_RAND}}, + {"curandCreatePoissonDistribution", + {"hiprandCreatePoissonDistribution", CONV_MATH_FUNC, API_RAND}}, + {"curandDestroyDistribution", {"hiprandDestroyDistribution", CONV_MATH_FUNC, API_RAND}}, + {"curandDestroyGenerator", {"hiprandDestroyGenerator", CONV_MATH_FUNC, API_RAND}}, + {"curandGenerate", {"hiprandGenerate", CONV_MATH_FUNC, API_RAND}}, + {"curandGenerateLogNormal", {"hiprandGenerateLogNormal", CONV_MATH_FUNC, API_RAND}}, + {"curandGenerateLogNormalDouble", {"hiprandGenerateLogNormalDouble", CONV_MATH_FUNC, API_RAND}}, + {"curandGenerateLongLong", + {"hiprandGenerateLongLong", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, + {"curandGenerateNormal", {"hiprandGenerateNormal", CONV_MATH_FUNC, API_RAND}}, + {"curandGenerateNormalDouble", {"hiprandGenerateNormalDouble", CONV_MATH_FUNC, API_RAND}}, + {"curandGeneratePoisson", {"hiprandGeneratePoisson", CONV_MATH_FUNC, API_RAND}}, + {"curandGenerateSeeds", {"hiprandGenerateSeeds", CONV_MATH_FUNC, API_RAND}}, + {"curandGenerateUniform", {"hiprandGenerateUniform", CONV_MATH_FUNC, API_RAND}}, + {"curandGenerateUniformDouble", {"hiprandGenerateUniformDouble", CONV_MATH_FUNC, API_RAND}}, + {"curandGetDirectionVectors32", + {"hiprandGetDirectionVectors32", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, + {"curandGetDirectionVectors64", + {"hiprandGetDirectionVectors64", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, + {"curandGetProperty", {"hiprandGetProperty", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, + {"curandGetScrambleConstants32", + {"hiprandGetScrambleConstants32", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, + {"curandGetScrambleConstants64", + {"hiprandGetScrambleConstants64", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, + {"curandGetVersion", {"hiprandGetVersion", CONV_MATH_FUNC, API_RAND}}, + {"curandSetGeneratorOffset", {"hiprandSetGeneratorOffset", CONV_MATH_FUNC, API_RAND}}, + {"curandSetGeneratorOrdering", + {"hiprandSetGeneratorOrdering", CONV_MATH_FUNC, API_RAND, HIP_UNSUPPORTED}}, + {"curandSetPseudoRandomGeneratorSeed", + {"hiprandSetPseudoRandomGeneratorSeed", CONV_MATH_FUNC, API_RAND}}, + {"curandSetQuasiRandomGeneratorDimensions", + {"hiprandSetQuasiRandomGeneratorDimensions", CONV_MATH_FUNC, API_RAND}}, + {"curandSetStream", {"hiprandSetStream", CONV_MATH_FUNC, API_RAND}}, // RAND Device functions - {"curand", {"hiprand", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_init", {"hiprand_init", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_log_normal", {"hiprand_log_normal", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_log_normal_double", {"hiprand_log_normal_double", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_log_normal2", {"hiprand_log_normal2", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_log_normal2_double", {"hiprand_log_normal2_double", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_log_normal4", {"hiprand_log_normal4", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_log_normal4_double", {"hiprand_log_normal4_double", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_mtgp32_single", {"hiprand_mtgp32_single", CONV_DEVICE_FUNC, API_RAND, HIP_UNSUPPORTED}}, - {"curand_mtgp32_single_specific", {"hiprand_mtgp32_single_specific", CONV_DEVICE_FUNC, API_RAND, HIP_UNSUPPORTED}}, - {"curand_mtgp32_specific", {"hiprand_mtgp32_specific", CONV_DEVICE_FUNC, API_RAND, HIP_UNSUPPORTED}}, - {"curand_normal", {"hiprand_normal", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_normal_double", {"hiprand_normal_double", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_normal2", {"hiprand_normal2", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_normal2_double", {"hiprand_normal2_double", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_normal4", {"hiprand_normal4", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_normal4_double", {"hiprand_normal4_double", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_uniform", {"hiprand_uniform", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_uniform_double", {"hiprand_uniform_double", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_uniform2_double", {"hiprand_uniform2_double", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_uniform4", {"hiprand_uniform4", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_uniform4_double", {"hiprand_uniform4_double", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_discrete", {"hiprand_discrete", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_discrete4", {"hiprand_discrete4", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_poisson", {"hiprand_poisson", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_poisson4", {"hiprand_poisson4", CONV_DEVICE_FUNC, API_RAND}}, - {"curand_Philox4x32_10", {"hiprand_Philox4x32_10", CONV_DEVICE_FUNC, API_RAND, HIP_UNSUPPORTED}}, + {"curand", {"hiprand", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_init", {"hiprand_init", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_log_normal", {"hiprand_log_normal", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_log_normal_double", {"hiprand_log_normal_double", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_log_normal2", {"hiprand_log_normal2", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_log_normal2_double", {"hiprand_log_normal2_double", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_log_normal4", {"hiprand_log_normal4", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_log_normal4_double", {"hiprand_log_normal4_double", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_mtgp32_single", + {"hiprand_mtgp32_single", CONV_DEVICE_FUNC, API_RAND, HIP_UNSUPPORTED}}, + {"curand_mtgp32_single_specific", + {"hiprand_mtgp32_single_specific", CONV_DEVICE_FUNC, API_RAND, HIP_UNSUPPORTED}}, + {"curand_mtgp32_specific", + {"hiprand_mtgp32_specific", CONV_DEVICE_FUNC, API_RAND, HIP_UNSUPPORTED}}, + {"curand_normal", {"hiprand_normal", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_normal_double", {"hiprand_normal_double", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_normal2", {"hiprand_normal2", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_normal2_double", {"hiprand_normal2_double", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_normal4", {"hiprand_normal4", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_normal4_double", {"hiprand_normal4_double", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_uniform", {"hiprand_uniform", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_uniform_double", {"hiprand_uniform_double", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_uniform2_double", {"hiprand_uniform2_double", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_uniform4", {"hiprand_uniform4", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_uniform4_double", {"hiprand_uniform4_double", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_discrete", {"hiprand_discrete", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_discrete4", {"hiprand_discrete4", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_poisson", {"hiprand_poisson", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_poisson4", {"hiprand_poisson4", CONV_DEVICE_FUNC, API_RAND}}, + {"curand_Philox4x32_10", + {"hiprand_Philox4x32_10", CONV_DEVICE_FUNC, API_RAND, HIP_UNSUPPORTED}}, // unchanged function names: skipahead, skipahead_sequence, skipahead_subsequence }; diff --git a/hipamd/hipify-clang/src/HipifyAction.cpp b/hipamd/hipify-clang/src/HipifyAction.cpp index 76efe9bf85..1f9a58687a 100644 --- a/hipamd/hipify-clang/src/HipifyAction.cpp +++ b/hipamd/hipify-clang/src/HipifyAction.cpp @@ -25,7 +25,8 @@ void HipifyAction::RewriteString(StringRef s, clang::SourceLocation start) { const auto found = CUDA_RENAMES_MAP().find(name); if (found != CUDA_RENAMES_MAP().end()) { StringRef repName = found->second.hipName; - hipCounter counter = {"[string literal]", ConvTypes::CONV_LITERAL, ApiTypes::API_RUNTIME, found->second.unsupported}; + hipCounter counter = {"[string literal]", ConvTypes::CONV_LITERAL, + ApiTypes::API_RUNTIME, found->second.unsupported}; Statistics::current().incrementCounter(counter, name.str()); if (!counter.unsupported) { @@ -77,7 +78,8 @@ void HipifyAction::RewriteToken(const clang::Token& t) { if (found->second.unsupported) { // An unsupported identifier? Curses! Warn the user. clang::DiagnosticsEngine& DE = getCompilerInstance().getDiagnostics(); - const auto ID = DE.getCustomDiagID(clang::DiagnosticsEngine::Warning, "CUDA identifier unsupported in hip"); + const auto ID = DE.getCustomDiagID(clang::DiagnosticsEngine::Warning, + "CUDA identifier unsupported in hip"); DE.Report(sl, ID); return; } @@ -94,8 +96,10 @@ clang::SourceRange getReadRange(clang::SourceManager& SM, const clang::SourceRan clang::SourceLocation begin = exprRange.getBegin(); clang::SourceLocation end = exprRange.getEnd(); - bool beginSafe = !SM.isMacroBodyExpansion(begin) || clang::Lexer::isAtStartOfMacroExpansion(begin, SM, clang::LangOptions{}); - bool endSafe = !SM.isMacroBodyExpansion(end) || clang::Lexer::isAtEndOfMacroExpansion(end, SM, clang::LangOptions{}); + bool beginSafe = !SM.isMacroBodyExpansion(begin) || + clang::Lexer::isAtStartOfMacroExpansion(begin, SM, clang::LangOptions{}); + bool endSafe = !SM.isMacroBodyExpansion(end) || + clang::Lexer::isAtEndOfMacroExpansion(end, SM, clang::LangOptions{}); if (beginSafe && endSafe) { return {SM.getFileLoc(begin), SM.getFileLoc(end)}; @@ -120,7 +124,9 @@ clang::SourceRange getWriteRange(clang::SourceManager& SM, const clang::SourceRa StringRef readSourceText(clang::SourceManager& SM, const clang::SourceRange& exprRange) { - return clang::Lexer::getSourceText(clang::CharSourceRange::getTokenRange(getReadRange(SM, exprRange)), SM, clang::LangOptions(), nullptr); + return clang::Lexer::getSourceText( + clang::CharSourceRange::getTokenRange(getReadRange(SM, exprRange)), SM, + clang::LangOptions(), nullptr); } /** @@ -135,28 +141,36 @@ std::string stringifyZeroDefaultedArg(clang::SourceManager& SM, const clang::Exp } } -} // anonymous namespace +} // anonymous namespace -bool HipifyAction::Exclude(const hipCounter & hipToken) { +bool HipifyAction::Exclude(const hipCounter& hipToken) { switch (hipToken.type) { case CONV_INCLUDE_CUDA_MAIN_H: switch (hipToken.apiType) { case API_DRIVER: case API_RUNTIME: - if (insertedRuntimeHeader) { return true; } + if (insertedRuntimeHeader) { + return true; + } insertedRuntimeHeader = true; return false; case API_BLAS: - if (insertedBLASHeader) { return true; } + if (insertedBLASHeader) { + return true; + } insertedBLASHeader = true; return false; case API_RAND: if (hipToken.hipName == "hiprand_kernel.h") { - if (insertedRAND_kernelHeader) { return true; } + if (insertedRAND_kernelHeader) { + return true; + } insertedRAND_kernelHeader = true; return false; } else if (hipToken.hipName == "hiprand.h") { - if (insertedRANDHeader) { return true; } + if (insertedRANDHeader) { + return true; + } insertedRANDHeader = true; return false; } @@ -167,7 +181,9 @@ bool HipifyAction::Exclude(const hipCounter & hipToken) { case CONV_INCLUDE: switch (hipToken.apiType) { case API_RAND: - if (insertedRAND_kernelHeader) { return true; } + if (insertedRAND_kernelHeader) { + return true; + } insertedRAND_kernelHeader = true; return false; default: @@ -180,13 +196,11 @@ bool HipifyAction::Exclude(const hipCounter & hipToken) { return false; } -void HipifyAction::InclusionDirective(clang::SourceLocation hash_loc, - const clang::Token&, - StringRef file_name, - bool is_angled, +void HipifyAction::InclusionDirective(clang::SourceLocation hash_loc, const clang::Token&, + StringRef file_name, bool is_angled, clang::CharSourceRange filename_range, - const clang::FileEntry*, StringRef, - StringRef, const clang::Module*) { + const clang::FileEntry*, StringRef, StringRef, + const clang::Module*) { clang::SourceManager& SM = getCompilerInstance().getSourceManager(); if (!SM.isWrittenInMainFile(hash_loc)) { return; @@ -208,7 +222,8 @@ void HipifyAction::InclusionDirective(clang::SourceLocation hash_loc, clang::SourceLocation sl = filename_range.getBegin(); if (found->second.unsupported) { clang::DiagnosticsEngine& DE = getCompilerInstance().getDiagnostics(); - DE.Report(sl, DE.getCustomDiagID(clang::DiagnosticsEngine::Warning, "Unsupported CUDA header")); + DE.Report(sl, + DE.getCustomDiagID(clang::DiagnosticsEngine::Warning, "Unsupported CUDA header")); return; } @@ -220,19 +235,22 @@ void HipifyAction::InclusionDirective(clang::SourceLocation hash_loc, if (is_angled) { newInclude = llvm::Twine("<" + found->second.hipName + ">").toStringRef(includeBuffer); } else { - newInclude = llvm::Twine("\"" + found->second.hipName + "\"").toStringRef(includeBuffer); + newInclude = + llvm::Twine("\"" + found->second.hipName + "\"").toStringRef(includeBuffer); } } else { - // hashLoc is location of the '#', thus replacing the whole include directive by empty newInclude starting with '#'. + // hashLoc is location of the '#', thus replacing the whole include directive by empty + // newInclude starting with '#'. sl = hash_loc; } - const char *B = SM.getCharacterData(sl); - const char *E = SM.getCharacterData(filename_range.getEnd()); + const char* B = SM.getCharacterData(sl); + const char* E = SM.getCharacterData(filename_range.getEnd()); ct::Replacement Rep(SM, sl, E - B, newInclude); insertReplacement(Rep, clang::FullSourceLoc{sl, SM}); } -void HipifyAction::PragmaDirective(clang::SourceLocation Loc, clang::PragmaIntroducerKind Introducer) { +void HipifyAction::PragmaDirective(clang::SourceLocation Loc, + clang::PragmaIntroducerKind Introducer) { if (pragmaOnce) { return; } @@ -266,7 +284,8 @@ bool HipifyAction::cudaLaunchKernel(const clang::ast_matchers::MatchFinder::Matc const clang::Expr& calleeExpr = *(launchKernel->getCallee()); OS << "hipLaunchKernelGGL(" << readSourceText(*SM, calleeExpr.getSourceRange()) << ", "; - // Next up are the four kernel configuration parameters, the last two of which are optional and default to zero. + // Next up are the four kernel configuration parameters, the last two of which are optional and + // default to zero. const clang::CallExpr& config = *(launchKernel->getConfig()); // Copy the two dimensional arguments verbatim. @@ -293,11 +312,14 @@ bool HipifyAction::cudaLaunchKernel(const clang::ast_matchers::MatchFinder::Matc OS << ")"; - clang::SourceRange replacementRange = getWriteRange(*SM, {launchKernel->getLocStart(), launchKernel->getLocEnd()}); + clang::SourceRange replacementRange = + getWriteRange(*SM, {launchKernel->getLocStart(), launchKernel->getLocEnd()}); clang::SourceLocation launchStart = replacementRange.getBegin(); clang::SourceLocation launchEnd = replacementRange.getEnd(); - size_t length = SM->getCharacterData(clang::Lexer::getLocForEndOfToken(launchEnd, 0, *SM, DefaultLangOptions)) - SM->getCharacterData(launchStart); + size_t length = SM->getCharacterData( + clang::Lexer::getLocForEndOfToken(launchEnd, 0, *SM, DefaultLangOptions)) - + SM->getCharacterData(launchStart); ct::Replacement Rep(*SM, launchStart, length, OS.str()); clang::FullSourceLoc fullSL(launchStart, *SM); @@ -308,7 +330,8 @@ bool HipifyAction::cudaLaunchKernel(const clang::ast_matchers::MatchFinder::Matc return true; } -bool HipifyAction::cudaSharedIncompleteArrayVar(const clang::ast_matchers::MatchFinder::MatchResult& Result) { +bool HipifyAction::cudaSharedIncompleteArrayVar( + const clang::ast_matchers::MatchFinder::MatchResult& Result) { StringRef refName = "cudaSharedIncompleteArrayVar"; auto* sharedVar = Result.Nodes.getNodeAs(refName); if (!sharedVar) { @@ -356,7 +379,8 @@ bool HipifyAction::cudaSharedIncompleteArrayVar(const clang::ast_matchers::Match return true; } -void HipifyAction::insertReplacement(const ct::Replacement& rep, const clang::FullSourceLoc& fullSL) { +void HipifyAction::insertReplacement(const ct::Replacement& rep, + const clang::FullSourceLoc& fullSL) { llcompat::insertReplacement(*replacements, rep); if (PrintStats) { rep.getLength(); @@ -365,22 +389,19 @@ void HipifyAction::insertReplacement(const ct::Replacement& rep, const clang::Fu } } -std::unique_ptr HipifyAction::CreateASTConsumer(clang::CompilerInstance& CI, llvm::StringRef) { +std::unique_ptr HipifyAction::CreateASTConsumer(clang::CompilerInstance& CI, + llvm::StringRef) { Finder.reset(new clang::ast_matchers::MatchFinder); // Replace the <<<...>>> language extension with a hip kernel launch - Finder->addMatcher(mat::cudaKernelCallExpr(mat::isExpansionInMainFile()).bind("cudaLaunchKernel"), this); - Finder->addMatcher( - mat::varDecl( - mat::isExpansionInMainFile(), - mat::allOf( - mat::hasAttr(clang::attr::CUDAShared), - mat::hasType(mat::incompleteArrayType()) - ) - ).bind("cudaSharedIncompleteArrayVar"), - this - ); + mat::cudaKernelCallExpr(mat::isExpansionInMainFile()).bind("cudaLaunchKernel"), this); + + Finder->addMatcher(mat::varDecl(mat::isExpansionInMainFile(), + mat::allOf(mat::hasAttr(clang::attr::CUDAShared), + mat::hasType(mat::incompleteArrayType()))) + .bind("cudaSharedIncompleteArrayVar"), + this); // Ownership is transferred to the caller... return Finder->newASTConsumer(); @@ -389,9 +410,9 @@ std::unique_ptr HipifyAction::CreateASTConsumer(clang::Compi void HipifyAction::EndSourceFileAction() { // Insert the hip header, if we didn't already do it by accident during substitution. if (!insertedRuntimeHeader) { - // It's not sufficient to just replace CUDA headers with hip ones, because numerous CUDA headers are - // implicitly included by the compiler. Instead, we _delete_ CUDA headers, and unconditionally insert - // one copy of the hip include into every file. + // It's not sufficient to just replace CUDA headers with hip ones, because numerous CUDA + // headers are implicitly included by the compiler. Instead, we _delete_ CUDA headers, and + // unconditionally insert one copy of the hip include into every file. clang::SourceManager& SM = getCompilerInstance().getSourceManager(); clang::SourceLocation sl; if (pragmaOnce) { @@ -418,22 +439,25 @@ namespace { class PPCallbackProxy : public clang::PPCallbacks { HipifyAction& hipifyAction; -public: - explicit PPCallbackProxy(HipifyAction& action): hipifyAction(action) {} + public: + explicit PPCallbackProxy(HipifyAction& action) : hipifyAction(action) {} void InclusionDirective(clang::SourceLocation hash_loc, const clang::Token& include_token, - StringRef file_name, bool is_angled, clang::CharSourceRange filename_range, - const clang::FileEntry* file, StringRef search_path, StringRef relative_path, + StringRef file_name, bool is_angled, + clang::CharSourceRange filename_range, const clang::FileEntry* file, + StringRef search_path, StringRef relative_path, const clang::Module* imported) override { - hipifyAction.InclusionDirective(hash_loc, include_token, file_name, is_angled, filename_range, file, search_path, relative_path, imported); + hipifyAction.InclusionDirective(hash_loc, include_token, file_name, is_angled, + filename_range, file, search_path, relative_path, imported); } - void PragmaDirective(clang::SourceLocation Loc, clang::PragmaIntroducerKind Introducer) override { + void PragmaDirective(clang::SourceLocation Loc, + clang::PragmaIntroducerKind Introducer) override { hipifyAction.PragmaDirective(Loc, Introducer); } }; -} +} // namespace void HipifyAction::ExecuteAction() { clang::Preprocessor& PP = getCompilerInstance().getPreprocessor(); @@ -444,10 +468,10 @@ void HipifyAction::ExecuteAction() { clang::Lexer RawLex(SM.getMainFileID(), FromFile, SM, PP.getLangOpts()); RawLex.SetKeepWhitespaceMode(true); - // Perform a token-level rewrite of CUDA identifiers to hip ones. The raw-mode lexer gives us enough - // information to tell the difference between identifiers, string literals, and "other stuff". It also - // ignores preprocessor directives, so this transformation will operate inside preprocessor-deleted - // code. + // Perform a token-level rewrite of CUDA identifiers to hip ones. The raw-mode lexer gives us + // enough information to tell the difference between identifiers, string literals, and "other + // stuff". It also ignores preprocessor directives, so this transformation will operate inside + // preprocessor-deleted code. clang::Token RawTok; RawLex.LexFromRawLexer(RawTok); while (RawTok.isNot(clang::tok::eof)) { diff --git a/hipamd/hipify-clang/src/HipifyAction.h b/hipamd/hipify-clang/src/HipifyAction.h index 8c2195b28d..0714200926 100644 --- a/hipamd/hipify-clang/src/HipifyAction.h +++ b/hipamd/hipify-clang/src/HipifyAction.h @@ -15,14 +15,15 @@ namespace ct = clang::tooling; */ class HipifyAction : public clang::ASTFrontendAction, public clang::ast_matchers::MatchFinder::MatchCallback { -private: + private: ct::Replacements* replacements; std::unique_ptr Finder; - /// CUDA implicitly adds its runtime header. We rewrite explicitly-provided CUDA includes with equivalent - // ones, and track - using this flag - if the result led to us including the hip runtime header. If it did - // not, we insert it at the top of the file when we finish processing it. - // This approach means we do the best it's possible to do w.r.t preserving the user's include order. + /// CUDA implicitly adds its runtime header. We rewrite explicitly-provided CUDA includes with + /// equivalent + // ones, and track - using this flag - if the result led to us including the hip runtime header. + // If it did not, we insert it at the top of the file when we finish processing it. This + // approach means we do the best it's possible to do w.r.t preserving the user's include order. bool insertedRuntimeHeader = false; bool insertedBLASHeader = false; bool insertedRANDHeader = false; @@ -40,12 +41,11 @@ private: /** * Replace a CUDA identifier with the corresponding hip identifier, if applicable. */ - void RewriteToken(const clang::Token &t); + void RewriteToken(const clang::Token& t); -public: - explicit HipifyAction(ct::Replacements *replacements): - clang::ASTFrontendAction(), - replacements(replacements) {} + public: + explicit HipifyAction(ct::Replacements* replacements) + : clang::ASTFrontendAction(), replacements(replacements) {} // MatchCallback listeners bool cudaBuiltin(const clang::ast_matchers::MatchFinder::MatchResult& Result); @@ -55,24 +55,21 @@ public: /** * Called by the preprocessor for each include directive during the non-raw lexing pass. */ - void InclusionDirective(clang::SourceLocation hash_loc, - const clang::Token &include_token, - StringRef file_name, - bool is_angled, - clang::CharSourceRange filename_range, - const clang::FileEntry *file, - StringRef search_path, - StringRef relative_path, - const clang::Module *imported); + void InclusionDirective(clang::SourceLocation hash_loc, const clang::Token& include_token, + StringRef file_name, bool is_angled, + clang::CharSourceRange filename_range, const clang::FileEntry* file, + StringRef search_path, StringRef relative_path, + const clang::Module* imported); /** - * Called by the preprocessor for each pragma directive during the non-raw lexing pass. - */ + * Called by the preprocessor for each pragma directive during the non-raw lexing pass. + */ void PragmaDirective(clang::SourceLocation Loc, clang::PragmaIntroducerKind Introducer); -protected: + protected: /** - * Add a Replacement for the current file. These will all be applied after executing the FrontendAction. + * Add a Replacement for the current file. These will all be applied after executing the + * FrontendAction. */ void insertReplacement(const ct::Replacement& rep, const clang::FullSourceLoc& fullSL); @@ -87,12 +84,13 @@ protected: void EndSourceFileAction() override; /** - * MatchCallback API entry point. Called by the AST visitor while searching the AST for things we registered an - * interest for. + * MatchCallback API entry point. Called by the AST visitor while searching the AST for things + * we registered an interest for. */ void run(const clang::ast_matchers::MatchFinder::MatchResult& Result) override; - std::unique_ptr CreateASTConsumer(clang::CompilerInstance &CI, llvm::StringRef InFile) override; + std::unique_ptr CreateASTConsumer(clang::CompilerInstance& CI, + llvm::StringRef InFile) override; - bool Exclude(const hipCounter & hipToken); + bool Exclude(const hipCounter& hipToken); }; diff --git a/hipamd/hipify-clang/src/LLVMCompat.cpp b/hipamd/hipify-clang/src/LLVMCompat.cpp index 6b6dc18dd2..35bcbe9080 100644 --- a/hipamd/hipify-clang/src/LLVMCompat.cpp +++ b/hipamd/hipify-clang/src/LLVMCompat.cpp @@ -32,7 +32,8 @@ void insertReplacement(ct::Replacements& replacements, const ct::Replacement& re #endif } -void EnterPreprocessorTokenStream(clang::Preprocessor& _pp, const clang::Token *start, size_t len, bool DisableMacroExpansion) { +void EnterPreprocessorTokenStream(clang::Preprocessor& _pp, const clang::Token* start, size_t len, + bool DisableMacroExpansion) { #if (LLVM_VERSION_MAJOR == 3) && (LLVM_VERSION_MINOR == 8) _pp.EnterTokenStream(start, len, false, DisableMacroExpansion); #else @@ -40,4 +41,4 @@ void EnterPreprocessorTokenStream(clang::Preprocessor& _pp, const clang::Token * #endif } -} // namespace llcompat +} // namespace llcompat diff --git a/hipamd/hipify-clang/src/LLVMCompat.h b/hipamd/hipify-clang/src/LLVMCompat.h index 3e2fe1aebb..dbf7ff307f 100644 --- a/hipamd/hipify-clang/src/LLVMCompat.h +++ b/hipamd/hipify-clang/src/LLVMCompat.h @@ -18,9 +18,9 @@ namespace llcompat { * remain unchanged, so let's be slightly ugly about it here. :D */ #if LLVM_VERSION_MAJOR > 4 - #define GET_NUM_ARGS() getNumParams() +#define GET_NUM_ARGS() getNumParams() #else - #define GET_NUM_ARGS() getNumArgs() +#define GET_NUM_ARGS() getNumArgs() #endif void PrintStackTraceOnErrorSignal(); @@ -41,9 +41,7 @@ void insertReplacement(ct::Replacements& replacements, const ct::Replacement& re /** * Version-agnostic version of Preprocessor::EnterTokenStream(). */ -void EnterPreprocessorTokenStream(clang::Preprocessor& _pp, - const clang::Token *start, - size_t len, +void EnterPreprocessorTokenStream(clang::Preprocessor& _pp, const clang::Token* start, size_t len, bool DisableMacroExpansion); -} // namespace llcompat +} // namespace llcompat diff --git a/hipamd/hipify-clang/src/ReplacementsFrontendActionFactory.h b/hipamd/hipify-clang/src/ReplacementsFrontendActionFactory.h index 7896635ef6..fce5a970cf 100644 --- a/hipamd/hipify-clang/src/ReplacementsFrontendActionFactory.h +++ b/hipamd/hipify-clang/src/ReplacementsFrontendActionFactory.h @@ -17,12 +17,9 @@ template class ReplacementsFrontendActionFactory : public ct::FrontendActionFactory { ct::Replacements* replacements; -public: - explicit ReplacementsFrontendActionFactory(ct::Replacements* r): - ct::FrontendActionFactory(), - replacements(r) {} + public: + explicit ReplacementsFrontendActionFactory(ct::Replacements* r) + : ct::FrontendActionFactory(), replacements(r) {} - clang::FrontendAction* create() override { - return new T(replacements); - } + clang::FrontendAction* create() override { return new T(replacements); } }; diff --git a/hipamd/hipify-clang/src/Statistics.cpp b/hipamd/hipify-clang/src/Statistics.cpp index 4c5664a6b0..14ab0abde8 100644 --- a/hipamd/hipify-clang/src/Statistics.cpp +++ b/hipamd/hipify-clang/src/Statistics.cpp @@ -4,26 +4,26 @@ #include -const char *counterNames[NUM_CONV_TYPES] = { - "version", "init", "device", "mem", "kern", "coord_func", "math_func", "device_func", - "special_func", "stream", "event", "occupancy", "ctx", "peer", "module", - "cache", "exec", "err", "def", "tex", "gl", "graphics", - "surface", "jit", "d3d9", "d3d10", "d3d11", "vdpau", "egl", - "thread", "other", "include", "include_cuda_main_header", "type", "literal", - "numeric_literal" -}; +const char* counterNames[NUM_CONV_TYPES] = {"version", "init", "device", + "mem", "kern", "coord_func", + "math_func", "device_func", "special_func", + "stream", "event", "occupancy", + "ctx", "peer", "module", + "cache", "exec", "err", + "def", "tex", "gl", + "graphics", "surface", "jit", + "d3d9", "d3d10", "d3d11", + "vdpau", "egl", "thread", + "other", "include", "include_cuda_main_header", + "type", "literal", "numeric_literal"}; -const char *apiNames[NUM_API_TYPES] = { - "CUDA Driver API", "CUDA RT API", "CUBLAS API", "CURAND API" -}; +const char* apiNames[NUM_API_TYPES] = {"CUDA Driver API", "CUDA RT API", "CUBLAS API", + "CURAND API"}; namespace { -template -void conditionalPrint(ST *stream1, - ST2* stream2, - const std::string& s1, - const std::string& s2) { +template +void conditionalPrint(ST* stream1, ST2* stream2, const std::string& s1, const std::string& s2) { if (stream1) { *stream1 << s1; } @@ -37,8 +37,8 @@ void conditionalPrint(ST *stream1, /** * Print a named stat value to both the terminal and the CSV file. */ -template -void printStat(std::ostream *csv, llvm::raw_ostream* printOut, const std::string &name, T value) { +template +void printStat(std::ostream* csv, llvm::raw_ostream* printOut, const std::string& name, T value) { if (printOut) { *printOut << " " << name << ": " << value << "\n"; } @@ -49,12 +49,12 @@ void printStat(std::ostream *csv, llvm::raw_ostream* printOut, const std::string } -} // Anonymous namespace +} // Anonymous namespace void StatCounter::incrementCounter(const hipCounter& counter, std::string name) { counters[name]++; - apiCounters[(int) counter.apiType]++; - convTypeCounters[(int) counter.type]++; + apiCounters[(int)counter.apiType]++; + convTypeCounters[(int)counter.type]++; } void StatCounter::add(const StatCounter& other) { @@ -81,32 +81,36 @@ int StatCounter::getConvSum() { } void StatCounter::print(std::ostream* csv, llvm::raw_ostream* printOut, std::string prefix) { - conditionalPrint(csv, printOut, "\nCUDA ref type;Count\n", "[HIPIFY] info: " + prefix + " refs by type:\n"); + conditionalPrint(csv, printOut, "\nCUDA ref type;Count\n", + "[HIPIFY] info: " + prefix + " refs by type:\n"); for (int i = 0; i < NUM_CONV_TYPES; i++) { if (convTypeCounters[i] > 0) { printStat(csv, printOut, counterNames[i], convTypeCounters[i]); } } - conditionalPrint(csv, printOut, "\nCUDA API;Count\n", "[HIPIFY] info: " + prefix + " refs by API:\n"); + conditionalPrint(csv, printOut, "\nCUDA API;Count\n", + "[HIPIFY] info: " + prefix + " refs by API:\n"); for (int i = 0; i < NUM_API_TYPES; i++) { printStat(csv, printOut, apiNames[i], apiCounters[i]); } - conditionalPrint(csv, printOut, "\nCUDA ref name;Count\n", "[HIPIFY] info: " + prefix + " refs by names:\n"); - for (const auto &it : counters) { + conditionalPrint(csv, printOut, "\nCUDA ref name;Count\n", + "[HIPIFY] info: " + prefix + " refs by names:\n"); + for (const auto& it : counters) { printStat(csv, printOut, it.first, it.second); } } -Statistics::Statistics(std::string name): fileName(name) { +Statistics::Statistics(std::string name) : fileName(name) { // Compute the total bytes/lines in the input file. std::ifstream src_file(name, std::ios::binary | std::ios::ate); src_file.clear(); src_file.seekg(0); - totalLines = (int) std::count(std::istreambuf_iterator(src_file), std::istreambuf_iterator(), '\n'); - totalBytes = (int) src_file.tellg(); + totalLines = (int)std::count(std::istreambuf_iterator(src_file), + std::istreambuf_iterator(), '\n'); + totalBytes = (int)src_file.tellg(); // Mark the start time... startTime = chr::steady_clock::now(); @@ -115,7 +119,7 @@ Statistics::Statistics(std::string name): fileName(name) { ///////// Counter update routines ////////// -void Statistics::incrementCounter(const hipCounter &counter, std::string name) { +void Statistics::incrementCounter(const hipCounter& counter, std::string name) { if (counter.unsupported) { unsupported.incrementCounter(counter, name); } else { @@ -123,7 +127,7 @@ void Statistics::incrementCounter(const hipCounter &counter, std::string name) { } } -void Statistics::add(const Statistics &other) { +void Statistics::add(const Statistics& other) { supported.add(other.supported); unsupported.add(other.unsupported); totalBytes += other.totalBytes; @@ -131,61 +135,60 @@ void Statistics::add(const Statistics &other) { touchedBytes += other.touchedBytes; } -void Statistics::lineTouched(int lineNumber) { - touchedLines.insert(lineNumber); -} -void Statistics::bytesChanged(int bytes) { - touchedBytes += bytes; -} -void Statistics::markCompletion() { - completionTime = chr::steady_clock::now(); -} +void Statistics::lineTouched(int lineNumber) { touchedLines.insert(lineNumber); } +void Statistics::bytesChanged(int bytes) { touchedBytes += bytes; } +void Statistics::markCompletion() { completionTime = chr::steady_clock::now(); } ///////// Output functions ////////// void Statistics::print(std::ostream* csv, llvm::raw_ostream* printOut, bool skipHeader) { - if (!skipHeader) { - std::string str = "file \'" + fileName + "\' statistics:\n"; - conditionalPrint(csv, printOut, "\n" + str, "\n[HIPIFY] info: " + str); - } + if (!skipHeader) { + std::string str = "file \'" + fileName + "\' statistics:\n"; + conditionalPrint(csv, printOut, "\n" + str, "\n[HIPIFY] info: " + str); + } - size_t changedLines = touchedLines.size(); + size_t changedLines = touchedLines.size(); - // Total number of (un)supported refs that were converted. - int supportedSum = supported.getConvSum(); - int unsupportedSum = unsupported.getConvSum(); + // Total number of (un)supported refs that were converted. + int supportedSum = supported.getConvSum(); + int unsupportedSum = unsupported.getConvSum(); - printStat(csv, printOut, "CONVERTED refs count", supportedSum); - printStat(csv, printOut, "UNCONVERTED refs count", unsupportedSum); - printStat(csv, printOut, "CONVERSION %", 100 - std::lround(double(unsupportedSum * 100) / double(supportedSum + unsupportedSum))); - printStat(csv, printOut, "REPLACED bytes", touchedBytes); - printStat(csv, printOut, "TOTAL bytes", totalBytes); - printStat(csv, printOut, "CHANGED lines of code", changedLines); - printStat(csv, printOut, "TOTAL lines of code", totalLines); + printStat(csv, printOut, "CONVERTED refs count", supportedSum); + printStat(csv, printOut, "UNCONVERTED refs count", unsupportedSum); + printStat( + csv, printOut, "CONVERSION %", + 100 - std::lround(double(unsupportedSum * 100) / double(supportedSum + unsupportedSum))); + printStat(csv, printOut, "REPLACED bytes", touchedBytes); + printStat(csv, printOut, "TOTAL bytes", totalBytes); + printStat(csv, printOut, "CHANGED lines of code", changedLines); + printStat(csv, printOut, "TOTAL lines of code", totalLines); - if (totalBytes > 0) { - printStat(csv, printOut, "CODE CHANGED (in bytes) %", std::lround(double(touchedBytes * 100) / double(totalBytes))); - } + if (totalBytes > 0) { + printStat(csv, printOut, "CODE CHANGED (in bytes) %", + std::lround(double(touchedBytes * 100) / double(totalBytes))); + } - if (totalLines > 0) { - printStat(csv, printOut, "CODE CHANGED (in lines) %", std::lround(double(changedLines * 100) / double(totalLines))); - } + if (totalLines > 0) { + printStat(csv, printOut, "CODE CHANGED (in lines) %", + std::lround(double(changedLines * 100) / double(totalLines))); + } - typedef std::chrono::duration duration; - duration elapsed = completionTime - startTime; - std::stringstream stream; - stream << std::fixed << std::setprecision(2) << elapsed.count() / 1000; - printStat(csv, printOut, "TIME ELAPSED s", stream.str()); + typedef std::chrono::duration duration; + duration elapsed = completionTime - startTime; + std::stringstream stream; + stream << std::fixed << std::setprecision(2) << elapsed.count() / 1000; + printStat(csv, printOut, "TIME ELAPSED s", stream.str()); - supported.print(csv, printOut, "CONVERTED"); - unsupported.print(csv, printOut, "UNCONVERTED"); + supported.print(csv, printOut, "CONVERTED"); + unsupported.print(csv, printOut, "UNCONVERTED"); } -void Statistics::printAggregate(std::ostream *csv, llvm::raw_ostream* printOut) { +void Statistics::printAggregate(std::ostream* csv, llvm::raw_ostream* printOut) { Statistics globalStats = getAggregate(); - conditionalPrint(csv, printOut, "\nTOTAL statistics:\n", "\n[HIPIFY] info: TOTAL statistics:\n"); + conditionalPrint(csv, printOut, "\nTOTAL statistics:\n", + "\n[HIPIFY] info: TOTAL statistics:\n"); // A file is considered "converted" if we made any changes to it. int convertedFiles = 0; diff --git a/hipamd/hipify-clang/src/Statistics.h b/hipamd/hipify-clang/src/Statistics.h index 81be7b09a8..4052d9c028 100644 --- a/hipamd/hipify-clang/src/Statistics.h +++ b/hipamd/hipify-clang/src/Statistics.h @@ -49,20 +49,14 @@ enum ConvTypes { CONV_NUMERIC_LITERAL, CONV_LAST }; -constexpr int NUM_CONV_TYPES = (int) ConvTypes::CONV_LAST; +constexpr int NUM_CONV_TYPES = (int)ConvTypes::CONV_LAST; -enum ApiTypes { - API_DRIVER = 0, - API_RUNTIME, - API_BLAS, - API_RAND, - API_LAST -}; -constexpr int NUM_API_TYPES = (int) ApiTypes::API_LAST; +enum ApiTypes { API_DRIVER = 0, API_RUNTIME, API_BLAS, API_RAND, API_LAST }; +constexpr int NUM_API_TYPES = (int)ApiTypes::API_LAST; // The names of various fields in in the statistics reports. -extern const char *counterNames[NUM_CONV_TYPES]; -extern const char *apiNames[NUM_API_TYPES]; +extern const char* counterNames[NUM_CONV_TYPES]; +extern const char* apiNames[NUM_API_TYPES]; struct hipCounter { @@ -77,14 +71,14 @@ struct hipCounter { * Tracks a set of named counters, as well as counters for each of the type enums defined above. */ class StatCounter { -private: + private: // Each thing we track is either "supported" or "unsupported"... std::map counters; int apiCounters[NUM_API_TYPES] = {}; int convTypeCounters[NUM_CONV_TYPES] = {}; -public: + public: void incrementCounter(const hipCounter& counter, std::string name); /** @@ -115,15 +109,15 @@ class Statistics { chr::steady_clock::time_point startTime; chr::steady_clock::time_point completionTime; -public: + public: Statistics(std::string name); - void incrementCounter(const hipCounter &counter, std::string name); + void incrementCounter(const hipCounter& counter, std::string name); /** * Add the counters from `other` onto the counters of this object. */ - void add(const Statistics &other); + void add(const Statistics& other); void lineTouched(int lineNumber); void bytesChanged(int bytes); @@ -135,18 +129,18 @@ public: /////// Output functions /////// -public: - /** + public: + /** * Pretty-print the statistics stored in this object. * * @param csv Pointer to an output stream for the CSV to write. If null, no CSV is written - * @param printOut Pointer to an output stream to print human-readable textual stats to. If null, no - * such stats are produced. + * @param printOut Pointer to an output stream to print human-readable textual stats to. If + * null, no such stats are produced. */ void print(std::ostream* csv, llvm::raw_ostream* printOut, bool skipHeader = false); /// Print aggregated statistics for all registered counters. - static void printAggregate(std::ostream *csv, llvm::raw_ostream* printOut); + static void printAggregate(std::ostream* csv, llvm::raw_ostream* printOut); /////// Static nonsense /////// @@ -162,15 +156,15 @@ public: static Statistics getAggregate(); /** - * Convenient global entry point for updating the "active" Statistics. Since we operate single-threadedly - * processing one file at a time, this allows us to simply expose the stats for the current file globally, - * simplifying things. + * Convenient global entry point for updating the "active" Statistics. Since we operate + * single-threadedly processing one file at a time, this allows us to simply expose the stats + * for the current file globally, simplifying things. */ static Statistics& current(); /** - * Set the active Statistics object to the named one, creating it if necessary, and write the completion - * timestamp into the currently active one. + * Set the active Statistics object to the named one, creating it if necessary, and write the + * completion timestamp into the currently active one. */ static void setActive(std::string name); }; diff --git a/hipamd/hipify-clang/src/StringUtils.cpp b/hipamd/hipify-clang/src/StringUtils.cpp index ad55333bc8..a142ee9643 100644 --- a/hipamd/hipify-clang/src/StringUtils.cpp +++ b/hipamd/hipify-clang/src/StringUtils.cpp @@ -8,7 +8,7 @@ llvm::StringRef unquoteStr(llvm::StringRef s) { return s; } -void removePrefixIfPresent(std::string &s, std::string prefix) { +void removePrefixIfPresent(std::string& s, std::string prefix) { if (s.find(prefix) != 0) { return; } diff --git a/hipamd/hipify-clang/src/StringUtils.h b/hipamd/hipify-clang/src/StringUtils.h index 66a9be780f..f8432cea47 100644 --- a/hipamd/hipify-clang/src/StringUtils.h +++ b/hipamd/hipify-clang/src/StringUtils.h @@ -11,4 +11,4 @@ llvm::StringRef unquoteStr(llvm::StringRef s); /** * If `s` starts with `prefix`, remove it. Otherwise, does nothing. */ -void removePrefixIfPresent(std::string &s, std::string prefix); +void removePrefixIfPresent(std::string& s, std::string prefix); diff --git a/hipamd/hipify-clang/src/main.cpp b/hipamd/hipify-clang/src/main.cpp index ccf627b147..3d173b1298 100644 --- a/hipamd/hipify-clang/src/main.cpp +++ b/hipamd/hipify-clang/src/main.cpp @@ -46,111 +46,116 @@ namespace ct = clang::tooling; namespace { void copyFile(const std::string& src, const std::string& dst) { - std::ifstream source(src, std::ios::binary); - std::ofstream dest(dst, std::ios::binary); - dest << source.rdbuf(); + std::ifstream source(src, std::ios::binary); + std::ofstream dest(dst, std::ios::binary); + dest << source.rdbuf(); } -} // anonymous namespace +} // anonymous namespace -int main(int argc, const char **argv) { - llcompat::PrintStackTraceOnErrorSignal(); +int main(int argc, const char** argv) { + llcompat::PrintStackTraceOnErrorSignal(); - ct::CommonOptionsParser OptionsParser(argc, argv, ToolTemplateCategory, llvm::cl::OneOrMore); - std::vector fileSources = OptionsParser.getSourcePathList(); - std::string dst = OutputFilename; - if (!dst.empty() && fileSources.size() > 1) { - llvm::errs() << "[HIPIFY] conflict: -o and multiple source files are specified.\n"; - return 1; - } - - if (NoOutput) { - if (Inplace) { - llvm::errs() << "[HIPIFY] conflict: both -no-output and -inplace options are specified.\n"; - return 1; - } - if (!dst.empty()) { - llvm::errs() << "[HIPIFY] conflict: both -no-output and -o options are specified.\n"; - return 1; - } - } - - if (Examine) { - NoOutput = PrintStats = true; - } - - int Result = 0; - - // Arguments for the Statistics print routines. - std::unique_ptr csv = nullptr; - llvm::raw_ostream* statPrint = nullptr; - if (!OutputStatsFilename.empty()) { - csv = std::unique_ptr(new std::ofstream(OutputStatsFilename, std::ios_base::trunc)); - } - if (PrintStats) { - statPrint = &llvm::errs(); - } - - for (const auto & src : fileSources) { - if (dst.empty()) { - if (Inplace) { - dst = src; - } else { - dst = src + ".hip"; - } - } else if (Inplace) { - llvm::errs() << "[HIPIFY] conflict: both -o and -inplace options are specified.\n"; - return 1; + ct::CommonOptionsParser OptionsParser(argc, argv, ToolTemplateCategory, llvm::cl::OneOrMore); + std::vector fileSources = OptionsParser.getSourcePathList(); + std::string dst = OutputFilename; + if (!dst.empty() && fileSources.size() > 1) { + llvm::errs() << "[HIPIFY] conflict: -o and multiple source files are specified.\n"; + return 1; } - std::string tmpFile = src + ".hipify-tmp"; + if (NoOutput) { + if (Inplace) { + llvm::errs() + << "[HIPIFY] conflict: both -no-output and -inplace options are specified.\n"; + return 1; + } + if (!dst.empty()) { + llvm::errs() << "[HIPIFY] conflict: both -no-output and -o options are specified.\n"; + return 1; + } + } - // Create a copy of the file to work on. When we're done, we'll move this onto the - // output (which may mean overwriting the input, if we're in-place). - // Should we fail for some reason, we'll just leak this file and not corrupt the input. - copyFile(src, tmpFile); + if (Examine) { + NoOutput = PrintStats = true; + } - // Initialise the statistics counters for this file. - Statistics::setActive(src); + int Result = 0; - // RefactoringTool operates on the file in-place. Giving it the output path is no good, - // because that'll break relative includes, and we don't want to overwrite the input file. - // So what we do is operate on a copy, which we then move to the output. - ct::RefactoringTool Tool(OptionsParser.getCompilations(), tmpFile); - ct::Replacements& replacementsToUse = llcompat::getReplacements(Tool, tmpFile); + // Arguments for the Statistics print routines. + std::unique_ptr csv = nullptr; + llvm::raw_ostream* statPrint = nullptr; + if (!OutputStatsFilename.empty()) { + csv = std::unique_ptr( + new std::ofstream(OutputStatsFilename, std::ios_base::trunc)); + } + if (PrintStats) { + statPrint = &llvm::errs(); + } - ReplacementsFrontendActionFactory actionFactory(&replacementsToUse); + for (const auto& src : fileSources) { + if (dst.empty()) { + if (Inplace) { + dst = src; + } else { + dst = src + ".hip"; + } + } else if (Inplace) { + llvm::errs() << "[HIPIFY] conflict: both -o and -inplace options are specified.\n"; + return 1; + } - Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster("--cuda-host-only", ct::ArgumentInsertPosition::BEGIN)); + std::string tmpFile = src + ".hipify-tmp"; - // Ensure at least c++11 is used. - Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster("-std=c++11", ct::ArgumentInsertPosition::BEGIN)); + // Create a copy of the file to work on. When we're done, we'll move this onto the + // output (which may mean overwriting the input, if we're in-place). + // Should we fail for some reason, we'll just leak this file and not corrupt the input. + copyFile(src, tmpFile); + + // Initialise the statistics counters for this file. + Statistics::setActive(src); + + // RefactoringTool operates on the file in-place. Giving it the output path is no good, + // because that'll break relative includes, and we don't want to overwrite the input file. + // So what we do is operate on a copy, which we then move to the output. + ct::RefactoringTool Tool(OptionsParser.getCompilations(), tmpFile); + ct::Replacements& replacementsToUse = llcompat::getReplacements(Tool, tmpFile); + + ReplacementsFrontendActionFactory actionFactory(&replacementsToUse); + + Tool.appendArgumentsAdjuster( + ct::getInsertArgumentAdjuster("--cuda-host-only", ct::ArgumentInsertPosition::BEGIN)); + + // Ensure at least c++11 is used. + Tool.appendArgumentsAdjuster( + ct::getInsertArgumentAdjuster("-std=c++11", ct::ArgumentInsertPosition::BEGIN)); #if defined(HIPIFY_CLANG_RES) - Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster("-resource-dir=" HIPIFY_CLANG_RES)); + Tool.appendArgumentsAdjuster( + ct::getInsertArgumentAdjuster("-resource-dir=" HIPIFY_CLANG_RES)); #endif - Tool.appendArgumentsAdjuster(ct::getClangSyntaxOnlyAdjuster()); + Tool.appendArgumentsAdjuster(ct::getClangSyntaxOnlyAdjuster()); - // Hipify _all_ the things! - if (Tool.runAndSave(&actionFactory)) { - DEBUG(llvm::dbgs() << "Skipped some replacements.\n"); + // Hipify _all_ the things! + if (Tool.runAndSave(&actionFactory)) { + DEBUG(llvm::dbgs() << "Skipped some replacements.\n"); + } + + // Either move the tmpfile to the output, or remove it. + if (!NoOutput) { + rename(tmpFile.c_str(), dst.c_str()); + } else { + remove(tmpFile.c_str()); + } + + Statistics::current().markCompletion(); + Statistics::current().print(csv.get(), statPrint); + + dst.clear(); } - // Either move the tmpfile to the output, or remove it. - if (!NoOutput) { - rename(tmpFile.c_str(), dst.c_str()); - } else { - remove(tmpFile.c_str()); + if (fileSources.size() > 1) { + Statistics::printAggregate(csv.get(), statPrint); } - Statistics::current().markCompletion(); - Statistics::current().print(csv.get(), statPrint); - - dst.clear(); - } - - if (fileSources.size() > 1) { - Statistics::printAggregate(csv.get(), statPrint); - } - - return Result; + return Result; } diff --git a/hipamd/include/hip/channel_descriptor.h b/hipamd/include/hip/channel_descriptor.h index b8e750b079..842701bad7 100644 --- a/hipamd/include/hip/channel_descriptor.h +++ b/hipamd/include/hip/channel_descriptor.h @@ -28,9 +28,9 @@ THE SOFTWARE. // on NVCC path: -#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__) +#if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_PLATFORM_NVCC__) #include -#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__) +#elif defined(__HIP_PLATFORM_NVCC__) && !defined(__HIP_PLATFORM_HCC__) #include #else #error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); diff --git a/hipamd/include/hip/device_functions.h b/hipamd/include/hip/device_functions.h index aae6775d48..f6059f2026 100644 --- a/hipamd/include/hip/device_functions.h +++ b/hipamd/include/hip/device_functions.h @@ -23,11 +23,11 @@ THE SOFTWARE. #ifndef HIP_INCLUDE_HIP_DEVICE_FUNCTIONS_H #define HIP_INCLUDE_HIP_DEVICE_FUNCTIONS_H -#include +#include -#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__) +#if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_PLATFORM_NVCC__) #include -#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__) +#elif defined(__HIP_PLATFORM_NVCC__) && !defined(__HIP_PLATFORM_HCC__) #include #else #error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); diff --git a/hipamd/include/hip/driver_types.h b/hipamd/include/hip/driver_types.h index 5d06457dd5..d428ec7f2d 100644 --- a/hipamd/include/hip/driver_types.h +++ b/hipamd/include/hip/driver_types.h @@ -25,9 +25,9 @@ THE SOFTWARE. #include -#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__) +#if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_PLATFORM_NVCC__) #include -#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__) +#elif defined(__HIP_PLATFORM_NVCC__) && !defined(__HIP_PLATFORM_HCC__) #include "driver_types.h" #else #error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); diff --git a/hipamd/include/hip/hcc_detail/channel_descriptor.h b/hipamd/include/hip/hcc_detail/channel_descriptor.h index 4be023f6ca..5fb0faeee1 100644 --- a/hipamd/include/hip/hcc_detail/channel_descriptor.h +++ b/hipamd/include/hip/hcc_detail/channel_descriptor.h @@ -23,359 +23,313 @@ THE SOFTWARE. #ifndef HIP_INCLUDE_HIP_HCC_DETAIL_CHANNEL_DESCRIPTOR_H #define HIP_INCLUDE_HIP_HCC_DETAIL_CHANNEL_DESCRIPTOR_H -#include -#include +#include +#include #ifdef __cplusplus hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, hipChannelFormatKind f); static inline hipChannelFormatDesc hipCreateChannelDescHalf() { - int e = (int)sizeof(unsigned short) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); + int e = (int)sizeof(unsigned short) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); } static inline hipChannelFormatDesc hipCreateChannelDescHalf1() { - int e = (int)sizeof(unsigned short) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); + int e = (int)sizeof(unsigned short) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); } -static inline hipChannelFormatDesc hipCreateChannelDescHalf2() -{ - int e = (int)sizeof(unsigned short) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); +static inline hipChannelFormatDesc hipCreateChannelDescHalf2() { + int e = (int)sizeof(unsigned short) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); } -template +template static inline hipChannelFormatDesc hipCreateChannelDesc() { - return hipCreateChannelDesc(0, 0, 0, 0, hipChannelFormatKindNone); + return hipCreateChannelDesc(0, 0, 0, 0, hipChannelFormatKindNone); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(char) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(char) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed char) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed char) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned char) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned char) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned char) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned char) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed char) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed char) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned char) * 8; - return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned char) * 8; + return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed char) * 8; - return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed char) * 8; + return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned char) * 8; - return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned char) * 8; + return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed char) * 8; - return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed char) * 8; + return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned char) * 8; - return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned char) * 8; + return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed char) * 8; - return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed char) * 8; + return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned short) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned short) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed short) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed short) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned short) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned short) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed short) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed short) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned short) * 8; - return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned short) * 8; + return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed short) * 8; - return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed short) * 8; + return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned short) * 8; - return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned short) * 8; + return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed short) * 8; - return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed short) * 8; + return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned short) * 8; - return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned short) * 8; + return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed short) * 8; - return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed short) * 8; + return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned int) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned int) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed int) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed int) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned int) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned int) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed int) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed int) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned int) * 8; - return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned int) * 8; + return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed int) * 8; - return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed int) * 8; + return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned int) * 8; - return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned int) * 8; + return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed int) * 8; - return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed int) * 8; + return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned int) * 8; - return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned int) * 8; + return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed int) * 8; - return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed int) * 8; + return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(float) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(float) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(float) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(float) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindFloat); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(float) * 8; - return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindFloat); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(float) * 8; + return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindFloat); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(float) * 8; - return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindFloat); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(float) * 8; + return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindFloat); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(float) * 8; - return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindFloat); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(float) * 8; + return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindFloat); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned long) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned long) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed long) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed long) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned long) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned long) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed long) * 8; - return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed long) * 8; + return hipCreateChannelDesc(e, 0, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned long) * 8; - return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned long) * 8; + return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed long) * 8; - return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed long) * 8; + return hipCreateChannelDesc(e, e, 0, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned long) * 8; - return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned long) * 8; + return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed long) * 8; - return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed long) * 8; + return hipCreateChannelDesc(e, e, e, 0, hipChannelFormatKindSigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(unsigned long) * 8; - return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindUnsigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(unsigned long) * 8; + return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindUnsigned); } -template<> -inline hipChannelFormatDesc hipCreateChannelDesc() -{ - int e = (int)sizeof(signed long) * 8; - return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); +template <> +inline hipChannelFormatDesc hipCreateChannelDesc() { + int e = (int)sizeof(signed long) * 8; + return hipCreateChannelDesc(e, e, e, e, hipChannelFormatKindSigned); } #else -struct hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, enum hipChannelFormatKind f); +struct hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, + enum hipChannelFormatKind f); #endif diff --git a/hipamd/include/hip/hcc_detail/code_object_bundle.hpp b/hipamd/include/hip/hcc_detail/code_object_bundle.hpp index 1d2d96795c..c36dd91813 100644 --- a/hipamd/include/hip/hcc_detail/code_object_bundle.hpp +++ b/hipamd/include/hip/hcc_detail/code_object_bundle.hpp @@ -32,129 +32,103 @@ THE SOFTWARE. #include #include -namespace hip_impl -{ - hsa_isa_t triple_to_hsa_isa(const std::string& triple); +namespace hip_impl { +hsa_isa_t triple_to_hsa_isa(const std::string& triple); - struct Bundled_code { - union Header { - struct { - std::uint64_t offset; - std::uint64_t bundle_sz; - std::uint64_t triple_sz; - }; - char cbuf[sizeof(offset) + sizeof(bundle_sz) + sizeof(triple_sz)]; - } header; - std::string triple; - std::vector blob; - }; +struct Bundled_code { + union Header { + struct { + std::uint64_t offset; + std::uint64_t bundle_sz; + std::uint64_t triple_sz; + }; + char cbuf[sizeof(offset) + sizeof(bundle_sz) + sizeof(triple_sz)]; + } header; + std::string triple; + std::vector blob; +}; - class Bundled_code_header { - // DATA - STATICS - static constexpr const char magic_string_[] = - "__CLANG_OFFLOAD_BUNDLE__"; - static constexpr auto magic_string_sz_ = sizeof(magic_string_) - 1; +class Bundled_code_header { + // DATA - STATICS + static constexpr const char magic_string_[] = "__CLANG_OFFLOAD_BUNDLE__"; + static constexpr auto magic_string_sz_ = sizeof(magic_string_) - 1; - // DATA - union Header_ { - struct { - char bundler_magic_string_[magic_string_sz_]; - std::uint64_t bundle_cnt_; - }; - char cbuf_[sizeof(bundler_magic_string_) + sizeof(bundle_cnt_)]; - } header_; - std::vector bundles_; + // DATA + union Header_ { + struct { + char bundler_magic_string_[magic_string_sz_]; + std::uint64_t bundle_cnt_; + }; + char cbuf_[sizeof(bundler_magic_string_) + sizeof(bundle_cnt_)]; + } header_; + std::vector bundles_; - // FRIENDS - MANIPULATORS - template - friend - inline - bool read( - RandomAccessIterator f, - RandomAccessIterator l, - Bundled_code_header& x) - { - if (f == l) return false; + // FRIENDS - MANIPULATORS + template + friend inline bool read(RandomAccessIterator f, RandomAccessIterator l, + Bundled_code_header& x) { + if (f == l) return false; - std::copy_n(f, sizeof(x.header_.cbuf_), x.header_.cbuf_); + std::copy_n(f, sizeof(x.header_.cbuf_), x.header_.cbuf_); - if (valid(x)) { - x.bundles_.resize(x.header_.bundle_cnt_); + if (valid(x)) { + x.bundles_.resize(x.header_.bundle_cnt_); - auto it = f + sizeof(x.header_.cbuf_); - for (auto&& y : x.bundles_) { - std::copy_n(it, sizeof(y.header.cbuf), y.header.cbuf); - it += sizeof(y.header.cbuf); + auto it = f + sizeof(x.header_.cbuf_); + for (auto&& y : x.bundles_) { + std::copy_n(it, sizeof(y.header.cbuf), y.header.cbuf); + it += sizeof(y.header.cbuf); - y.triple.assign(it, it + y.header.triple_sz); + y.triple.assign(it, it + y.header.triple_sz); - std::copy_n( - f + y.header.offset, - y.header.bundle_sz, - std::back_inserter(y.blob)); + std::copy_n(f + y.header.offset, y.header.bundle_sz, std::back_inserter(y.blob)); - it += y.header.triple_sz; - } - - return true; + it += y.header.triple_sz; } - return false; - } - friend - inline - bool read(const std::vector& blob, Bundled_code_header& x) - { - return read(blob.cbegin(), blob.cend(), x); - } - friend - inline - bool read(std::istream& is, Bundled_code_header& x) - { - return read(std::vector{ - std::istreambuf_iterator{is}, - std::istreambuf_iterator{}}, - x); + return true; } - // FRIENDS - ACCESSORS - friend - inline - bool valid(const Bundled_code_header& x) - { - return std::equal( - magic_string_, - magic_string_ + magic_string_sz_, - x.header_.bundler_magic_string_); - } - friend - inline - const std::vector& bundles(const Bundled_code_header& x) - { - return x.bundles_; - } - public: - // CREATORS - Bundled_code_header() = default; - template - Bundled_code_header(RandomAccessIterator f, RandomAccessIterator l); - explicit - Bundled_code_header(const std::vector& blob); - explicit - Bundled_code_header(const void* maybe_blob); - Bundled_code_header(const Bundled_code_header&) = default; - Bundled_code_header(Bundled_code_header&&) = default; - ~Bundled_code_header() = default; - - // MANIPULATORS - Bundled_code_header& operator=(const Bundled_code_header&) = default; - Bundled_code_header& operator=(Bundled_code_header&&) = default; - }; - - // CREATORS - template - Bundled_code_header::Bundled_code_header(RandomAccessIterator f, RandomAccessIterator l) : Bundled_code_header{} - { - read(f, l, *this); + return false; } -} // Namespace hip_impl. + friend inline bool read(const std::vector& blob, Bundled_code_header& x) { + return read(blob.cbegin(), blob.cend(), x); + } + friend inline bool read(std::istream& is, Bundled_code_header& x) { + return read( + std::vector{std::istreambuf_iterator{is}, std::istreambuf_iterator{}}, + x); + } + + // FRIENDS - ACCESSORS + friend inline bool valid(const Bundled_code_header& x) { + return std::equal(magic_string_, magic_string_ + magic_string_sz_, + x.header_.bundler_magic_string_); + } + friend inline const std::vector& bundles(const Bundled_code_header& x) { + return x.bundles_; + } + + public: + // CREATORS + Bundled_code_header() = default; + template + Bundled_code_header(RandomAccessIterator f, RandomAccessIterator l); + explicit Bundled_code_header(const std::vector& blob); + explicit Bundled_code_header(const void* maybe_blob); + Bundled_code_header(const Bundled_code_header&) = default; + Bundled_code_header(Bundled_code_header&&) = default; + ~Bundled_code_header() = default; + + // MANIPULATORS + Bundled_code_header& operator=(const Bundled_code_header&) = default; + Bundled_code_header& operator=(Bundled_code_header&&) = default; +}; + +// CREATORS +template +Bundled_code_header::Bundled_code_header(RandomAccessIterator f, RandomAccessIterator l) + : Bundled_code_header{} { + read(f, l, *this); +} +} // Namespace hip_impl. diff --git a/hipamd/include/hip/hcc_detail/concepts.hpp b/hipamd/include/hip/hcc_detail/concepts.hpp index 18c1119b73..373cefb292 100644 --- a/hipamd/include/hip/hcc_detail/concepts.hpp +++ b/hipamd/include/hip/hcc_detail/concepts.hpp @@ -22,9 +22,9 @@ THE SOFTWARE. #pragma once -namespace hip_impl // Documentation only. +namespace hip_impl // Documentation only. { - #define requires(...) +#define requires(...) - #define FunctionalProcedure typename -} +#define FunctionalProcedure typename +} // namespace hip_impl diff --git a/hipamd/include/hip/hcc_detail/device_functions.h b/hipamd/include/hip/hcc_detail/device_functions.h index 8073503364..99713ed4d7 100644 --- a/hipamd/include/hip/hcc_detail/device_functions.h +++ b/hipamd/include/hip/hcc_detail/device_functions.h @@ -27,84 +27,81 @@ THE SOFTWARE. #include - - - // Single Precision Fast Math -__device__ float __cosf(float x); -__device__ float __exp10f(float x); -__device__ float __expf(float x); -__device__ static float __fadd_rd(float x, float y); -__device__ static float __fadd_rn(float x, float y); -__device__ static float __fadd_ru(float x, float y); -__device__ static float __fadd_rz(float x, float y); -__device__ static float __fdiv_rd(float x, float y); -__device__ static float __fdiv_rn(float x, float y); -__device__ static float __fdiv_ru(float x, float y); -__device__ static float __fdiv_rz(float x, float y); -__device__ static float __fdividef(float x, float y); -__device__ float __fmaf_rd(float x, float y, float z); -__device__ float __fmaf_rn(float x, float y, float z); -__device__ float __fmaf_ru(float x, float y, float z); -__device__ float __fmaf_rz(float x, float y, float z); -__device__ static float __fmul_rd(float x, float y); -__device__ static float __fmul_rn(float x, float y); -__device__ static float __fmul_ru(float x, float y); -__device__ static float __fmul_rz(float x, float y); -__device__ float __frcp_rd(float x); -__device__ float __frcp_rn(float x); -__device__ float __frcp_ru(float x); -__device__ float __frcp_rz(float x); -__device__ float __frsqrt_rn(float x); -__device__ float __fsqrt_rd(float x); -__device__ float __fsqrt_rn(float x); -__device__ float __fsqrt_ru(float x); -__device__ float __fsqrt_rz(float x); -__device__ static float __fsub_rd(float x, float y); -__device__ static float __fsub_rn(float x, float y); -__device__ static float __fsub_ru(float x, float y); -__device__ float __log10f(float x); -__device__ float __log2f(float x); -__device__ float __logf(float x); -__device__ float __powf(float base, float exponent); -__device__ static float __saturatef(float x); -__device__ void __sincosf(float x, float *s, float *c); -__device__ float __sinf(float x); -__device__ float __tanf(float x); +__device__ float __cosf(float x); +__device__ float __exp10f(float x); +__device__ float __expf(float x); +__device__ static float __fadd_rd(float x, float y); +__device__ static float __fadd_rn(float x, float y); +__device__ static float __fadd_ru(float x, float y); +__device__ static float __fadd_rz(float x, float y); +__device__ static float __fdiv_rd(float x, float y); +__device__ static float __fdiv_rn(float x, float y); +__device__ static float __fdiv_ru(float x, float y); +__device__ static float __fdiv_rz(float x, float y); +__device__ static float __fdividef(float x, float y); +__device__ float __fmaf_rd(float x, float y, float z); +__device__ float __fmaf_rn(float x, float y, float z); +__device__ float __fmaf_ru(float x, float y, float z); +__device__ float __fmaf_rz(float x, float y, float z); +__device__ static float __fmul_rd(float x, float y); +__device__ static float __fmul_rn(float x, float y); +__device__ static float __fmul_ru(float x, float y); +__device__ static float __fmul_rz(float x, float y); +__device__ float __frcp_rd(float x); +__device__ float __frcp_rn(float x); +__device__ float __frcp_ru(float x); +__device__ float __frcp_rz(float x); +__device__ float __frsqrt_rn(float x); +__device__ float __fsqrt_rd(float x); +__device__ float __fsqrt_rn(float x); +__device__ float __fsqrt_ru(float x); +__device__ float __fsqrt_rz(float x); +__device__ static float __fsub_rd(float x, float y); +__device__ static float __fsub_rn(float x, float y); +__device__ static float __fsub_ru(float x, float y); +__device__ float __log10f(float x); +__device__ float __log2f(float x); +__device__ float __logf(float x); +__device__ float __powf(float base, float exponent); +__device__ static float __saturatef(float x); +__device__ void __sincosf(float x, float* s, float* c); +__device__ float __sinf(float x); +__device__ float __tanf(float x); /* Double Precision Intrinsics */ -__device__ static double __dadd_rd(double x, double y); -__device__ static double __dadd_rn(double x, double y); -__device__ static double __dadd_ru(double x, double y); -__device__ static double __dadd_rz(double x, double y); -__device__ static double __ddiv_rd(double x, double y); -__device__ static double __ddiv_rn(double x, double y); -__device__ static double __ddiv_ru(double x, double y); -__device__ static double __ddiv_rz(double x, double y); -__device__ static double __dmul_rd(double x, double y); -__device__ static double __dmul_rn(double x, double y); -__device__ static double __dmul_ru(double x, double y); -__device__ static double __dmul_rz(double x, double y); -__device__ double __drcp_rd(double x); -__device__ double __drcp_rn(double x); -__device__ double __drcp_ru(double x); -__device__ double __drcp_rz(double x); -__device__ double __dsqrt_rd(double x); -__device__ double __dsqrt_rn(double x); -__device__ double __dsqrt_ru(double x); -__device__ double __dsqrt_rz(double x); -__device__ static double __dsub_rd(double x, double y); -__device__ static double __dsub_rn(double x, double y); -__device__ static double __dsub_ru(double x, double y); -__device__ static double __dsub_rz(double x, double y); -__device__ double __fma_rd(double x, double y, double z); -__device__ double __fma_rn(double x, double y, double z); -__device__ double __fma_ru(double x, double y, double z); -__device__ double __fma_rz(double x, double y, double z); +__device__ static double __dadd_rd(double x, double y); +__device__ static double __dadd_rn(double x, double y); +__device__ static double __dadd_ru(double x, double y); +__device__ static double __dadd_rz(double x, double y); +__device__ static double __ddiv_rd(double x, double y); +__device__ static double __ddiv_rn(double x, double y); +__device__ static double __ddiv_ru(double x, double y); +__device__ static double __ddiv_rz(double x, double y); +__device__ static double __dmul_rd(double x, double y); +__device__ static double __dmul_rn(double x, double y); +__device__ static double __dmul_ru(double x, double y); +__device__ static double __dmul_rz(double x, double y); +__device__ double __drcp_rd(double x); +__device__ double __drcp_rn(double x); +__device__ double __drcp_ru(double x); +__device__ double __drcp_rz(double x); +__device__ double __dsqrt_rd(double x); +__device__ double __dsqrt_rn(double x); +__device__ double __dsqrt_ru(double x); +__device__ double __dsqrt_rz(double x); +__device__ static double __dsub_rd(double x, double y); +__device__ static double __dsub_rn(double x, double y); +__device__ static double __dsub_ru(double x, double y); +__device__ static double __dsub_rz(double x, double y); +__device__ double __fma_rd(double x, double y, double z); +__device__ double __fma_rn(double x, double y, double z); +__device__ double __fma_ru(double x, double y, double z); +__device__ double __fma_rz(double x, double y, double z); // Single Precision Fast Math extern __attribute__((const)) float __hip_fast_cosf(float) __asm("llvm.cos.f32"); @@ -120,302 +117,170 @@ __device__ float __hip_fast_log10f(float); extern __attribute__((const)) float __hip_fast_log2f(float) __asm("llvm.log2.f32"); __device__ float __hip_fast_logf(float); __device__ float __hip_fast_powf(float, float); -__device__ void __hip_fast_sincosf(float,float*,float*); +__device__ void __hip_fast_sincosf(float, float*, float*); extern __attribute__((const)) float __hip_fast_sinf(float) __asm("llvm.sin.f32"); __device__ float __hip_fast_tanf(float); -extern __attribute__((const)) float __hip_fast_fmaf(float,float,float) __asm("llvm.fma.f32"); +extern __attribute__((const)) float __hip_fast_fmaf(float, float, float) __asm("llvm.fma.f32"); extern __attribute__((const)) float __hip_fast_frcp(float) __asm("llvm.amdgcn.rcp.f32"); extern __attribute__((const)) double __hip_fast_dsqrt(double) __asm("llvm.sqrt.f64"); -extern __attribute__((const)) double __hip_fast_fma(double,double,double) __asm("llvm.fma.f64"); +extern __attribute__((const)) double __hip_fast_fma(double, double, double) __asm("llvm.fma.f64"); extern __attribute__((const)) double __hip_fast_drcp(double) __asm("llvm.amdgcn.rcp.f64"); // Single Precision Fast Math -__device__ inline float __cosf(float x) { - return __hip_fast_cosf(x); -} +__device__ inline float __cosf(float x) { return __hip_fast_cosf(x); } -__device__ inline float __exp10f(float x) { - return __hip_fast_exp10f(x); -} +__device__ inline float __exp10f(float x) { return __hip_fast_exp10f(x); } -__device__ inline float __expf(float x) { - return __hip_fast_expf(x); -} +__device__ inline float __expf(float x) { return __hip_fast_expf(x); } -__device__ static inline float __fadd_rd(float x, float y) { - return x + y; -} +__device__ static inline float __fadd_rd(float x, float y) { return x + y; } -__device__ static inline float __fadd_rn(float x, float y) { - return x + y; -} +__device__ static inline float __fadd_rn(float x, float y) { return x + y; } -__device__ static inline float __fadd_ru(float x, float y) { - return x + y; -} +__device__ static inline float __fadd_ru(float x, float y) { return x + y; } -__device__ static inline float __fadd_rz(float x, float y) { - return x + y; -} +__device__ static inline float __fadd_rz(float x, float y) { return x + y; } -__device__ static inline float __fdiv_rd(float x, float y) { - return x / y; -} +__device__ static inline float __fdiv_rd(float x, float y) { return x / y; } -__device__ static inline float __fdiv_rn(float x, float y) { - return x / y; -} +__device__ static inline float __fdiv_rn(float x, float y) { return x / y; } -__device__ static inline float __fdiv_ru(float x, float y) { - return x / y; -} +__device__ static inline float __fdiv_ru(float x, float y) { return x / y; } -__device__ static inline float __fdiv_rz(float x, float y) { - return x / y; -} +__device__ static inline float __fdiv_rz(float x, float y) { return x / y; } -__device__ static inline float __fdividef(float x, float y) { - return x / y; -} +__device__ static inline float __fdividef(float x, float y) { return x / y; } -__device__ inline float __fmaf_rd(float x, float y, float z) { - return __hip_fast_fmaf(x, y, z); -} +__device__ inline float __fmaf_rd(float x, float y, float z) { return __hip_fast_fmaf(x, y, z); } -__device__ inline float __fmaf_rn(float x, float y, float z) { - return __hip_fast_fmaf(x, y, z); -} +__device__ inline float __fmaf_rn(float x, float y, float z) { return __hip_fast_fmaf(x, y, z); } -__device__ inline float __fmaf_ru(float x, float y, float z) { - return __hip_fast_fmaf(x, y, z); -} +__device__ inline float __fmaf_ru(float x, float y, float z) { return __hip_fast_fmaf(x, y, z); } -__device__ inline float __fmaf_rz(float x, float y, float z) { - return __hip_fast_fmaf(x, y, z); -} +__device__ inline float __fmaf_rz(float x, float y, float z) { return __hip_fast_fmaf(x, y, z); } -__device__ static inline float __fmul_rd(float x, float y) { - return x * y; -} +__device__ static inline float __fmul_rd(float x, float y) { return x * y; } -__device__ static inline float __fmul_rn(float x, float y) { - return x * y; -} +__device__ static inline float __fmul_rn(float x, float y) { return x * y; } -__device__ static inline float __fmul_ru(float x, float y) { - return x * y; -} +__device__ static inline float __fmul_ru(float x, float y) { return x * y; } -__device__ static inline float __fmul_rz(float x, float y) { - return x * y; -} +__device__ static inline float __fmul_rz(float x, float y) { return x * y; } -__device__ inline float __frcp_rd(float x) { - return __hip_fast_frcp(x); -} +__device__ inline float __frcp_rd(float x) { return __hip_fast_frcp(x); } -__device__ inline float __frcp_rn(float x) { - return __hip_fast_frcp(x); -} +__device__ inline float __frcp_rn(float x) { return __hip_fast_frcp(x); } -__device__ inline float __frcp_ru(float x) { - return __hip_fast_frcp(x); -} +__device__ inline float __frcp_ru(float x) { return __hip_fast_frcp(x); } -__device__ inline float __frcp_rz(float x) { - return __hip_fast_frcp(x); -} +__device__ inline float __frcp_rz(float x) { return __hip_fast_frcp(x); } -__device__ inline float __frsqrt_rn(float x) { - return __hip_fast_frsqrt_rn(x); -} +__device__ inline float __frsqrt_rn(float x) { return __hip_fast_frsqrt_rn(x); } -__device__ inline float __fsqrt_rd(float x) { - return __hip_fast_fsqrt_rd(x); -} +__device__ inline float __fsqrt_rd(float x) { return __hip_fast_fsqrt_rd(x); } -__device__ inline float __fsqrt_rn(float x) { - return __hip_fast_fsqrt_rn(x); -} +__device__ inline float __fsqrt_rn(float x) { return __hip_fast_fsqrt_rn(x); } -__device__ inline float __fsqrt_ru(float x) { - return __hip_fast_fsqrt_ru(x); -} +__device__ inline float __fsqrt_ru(float x) { return __hip_fast_fsqrt_ru(x); } -__device__ inline float __fsqrt_rz(float x) { - return __hip_fast_fsqrt_rz(x); -} +__device__ inline float __fsqrt_rz(float x) { return __hip_fast_fsqrt_rz(x); } -__device__ static inline float __fsub_rd(float x, float y) { - return x - y; -} +__device__ static inline float __fsub_rd(float x, float y) { return x - y; } -__device__ static inline float __fsub_rn(float x, float y) { - return x - y; -} +__device__ static inline float __fsub_rn(float x, float y) { return x - y; } -__device__ static inline float __fsub_ru(float x, float y) { - return x - y; -} +__device__ static inline float __fsub_ru(float x, float y) { return x - y; } -__device__ static inline float __fsub_rz(float x, float y) { - return x - y; -} +__device__ static inline float __fsub_rz(float x, float y) { return x - y; } -__device__ inline float __log10f(float x) { - return __hip_fast_log10f(x); -} +__device__ inline float __log10f(float x) { return __hip_fast_log10f(x); } -__device__ inline float __log2f(float x) { - return __hip_fast_log2f(x); -} +__device__ inline float __log2f(float x) { return __hip_fast_log2f(x); } -__device__ inline float __logf(float x) { - return __hip_fast_logf(x); -} +__device__ inline float __logf(float x) { return __hip_fast_logf(x); } __device__ inline float __powf(float base, float exponent) { - return __hip_fast_powf(base, exponent); + return __hip_fast_powf(base, exponent); } __device__ static inline float __saturatef(float x) { - x = x > 1.0f ? 1.0f : x; - x = x < 0.0f ? 0.0f : x; - return x; + x = x > 1.0f ? 1.0f : x; + x = x < 0.0f ? 0.0f : x; + return x; } -__device__ inline void __sincosf(float x, float *s, float *c) { - return __hip_fast_sincosf(x, s, c); +__device__ inline void __sincosf(float x, float* s, float* c) { + return __hip_fast_sincosf(x, s, c); } -__device__ inline float __sinf(float x) { - return __hip_fast_sinf(x); -} +__device__ inline float __sinf(float x) { return __hip_fast_sinf(x); } -__device__ inline float __tanf(float x) { - return __hip_fast_tanf(x); -} +__device__ inline float __tanf(float x) { return __hip_fast_tanf(x); } /* Double Precision Intrinsics */ -__device__ static inline double __dadd_rd(double x, double y) { - return x + y; -} +__device__ static inline double __dadd_rd(double x, double y) { return x + y; } -__device__ static inline double __dadd_rn(double x, double y) { - return x + y; -} +__device__ static inline double __dadd_rn(double x, double y) { return x + y; } -__device__ static inline double __dadd_ru(double x, double y) { - return x + y; -} +__device__ static inline double __dadd_ru(double x, double y) { return x + y; } -__device__ static inline double __dadd_rz(double x, double y) { - return x + y; -} +__device__ static inline double __dadd_rz(double x, double y) { return x + y; } -__device__ static inline double __ddiv_rd(double x, double y) { - return x / y; -} +__device__ static inline double __ddiv_rd(double x, double y) { return x / y; } -__device__ static inline double __ddiv_rn(double x, double y) { - return x / y; -} +__device__ static inline double __ddiv_rn(double x, double y) { return x / y; } -__device__ static inline double __ddiv_ru(double x, double y) { - return x / y; -} +__device__ static inline double __ddiv_ru(double x, double y) { return x / y; } -__device__ static inline double __ddiv_rz(double x, double y) { - return x / y; -} +__device__ static inline double __ddiv_rz(double x, double y) { return x / y; } -__device__ static inline double __dmul_rd(double x, double y) { - return x * y; -} +__device__ static inline double __dmul_rd(double x, double y) { return x * y; } -__device__ static inline double __dmul_rn(double x, double y) { - return x * y; -} +__device__ static inline double __dmul_rn(double x, double y) { return x * y; } -__device__ static inline double __dmul_ru(double x, double y) { - return x * y; -} +__device__ static inline double __dmul_ru(double x, double y) { return x * y; } -__device__ static inline double __dmul_rz(double x, double y) { - return x * y; -} +__device__ static inline double __dmul_rz(double x, double y) { return x * y; } -__device__ inline double __drcp_rd(double x) { - return __hip_fast_drcp(x); -} +__device__ inline double __drcp_rd(double x) { return __hip_fast_drcp(x); } -__device__ inline double __drcp_rn(double x) { - return __hip_fast_drcp(x); -} +__device__ inline double __drcp_rn(double x) { return __hip_fast_drcp(x); } -__device__ inline double __drcp_ru(double x) { - return __hip_fast_drcp(x); -} +__device__ inline double __drcp_ru(double x) { return __hip_fast_drcp(x); } -__device__ inline double __drcp_rz(double x) { - return __hip_fast_drcp(x); -} +__device__ inline double __drcp_rz(double x) { return __hip_fast_drcp(x); } -__device__ inline double __dsqrt_rd(double x) { - return __hip_fast_dsqrt(x); -} +__device__ inline double __dsqrt_rd(double x) { return __hip_fast_dsqrt(x); } -__device__ inline double __dsqrt_rn(double x) { - return __hip_fast_dsqrt(x); -} +__device__ inline double __dsqrt_rn(double x) { return __hip_fast_dsqrt(x); } -__device__ inline double __dsqrt_ru(double x) { - return __hip_fast_dsqrt(x); -} +__device__ inline double __dsqrt_ru(double x) { return __hip_fast_dsqrt(x); } -__device__ inline double __dsqrt_rz(double x) { - return __hip_fast_dsqrt(x); -} +__device__ inline double __dsqrt_rz(double x) { return __hip_fast_dsqrt(x); } -__device__ static inline double __dsub_rd(double x, double y) { - return x - y; -} +__device__ static inline double __dsub_rd(double x, double y) { return x - y; } -__device__ static inline double __dsub_rn(double x, double y) { - return x - y; -} +__device__ static inline double __dsub_rn(double x, double y) { return x - y; } -__device__ static inline double __dsub_ru(double x, double y) { - return x - y; -} +__device__ static inline double __dsub_ru(double x, double y) { return x - y; } -__device__ static inline double __dsub_rz(double x, double y) { - return x - y; -} +__device__ static inline double __dsub_rz(double x, double y) { return x - y; } -__device__ inline double __fma_rd(double x, double y, double z) { - return __hip_fast_fma(x, y, z); -} +__device__ inline double __fma_rd(double x, double y, double z) { return __hip_fast_fma(x, y, z); } -__device__ inline double __fma_rn(double x, double y, double z) { - return __hip_fast_fma(x, y, z); -} +__device__ inline double __fma_rn(double x, double y, double z) { return __hip_fast_fma(x, y, z); } -__device__ inline double __fma_ru(double x, double y, double z) { - return __hip_fast_fma(x, y, z); -} +__device__ inline double __fma_ru(double x, double y, double z) { return __hip_fast_fma(x, y, z); } -__device__ inline double __fma_rz(double x, double y, double z) { - return __hip_fast_fma(x, y, z); -} +__device__ inline double __fma_rz(double x, double y, double z) { return __hip_fast_fma(x, y, z); } extern "C" unsigned int __hip_hc_ir_umul24_int(unsigned int, unsigned int); @@ -425,8 +290,8 @@ extern "C" unsigned int __hip_hc_ir_umulhi_int(unsigned int, unsigned int); extern "C" unsigned int __hip_hc_ir_usad_int(unsigned int, unsigned int, unsigned int); // integer intrinsic function __poc __clz __ffs __brev -__device__ unsigned int __brev( unsigned int x); -__device__ unsigned long long int __brevll( unsigned long long int x); +__device__ unsigned int __brev(unsigned int x); +__device__ unsigned long long int __brevll(unsigned long long int x); __device__ unsigned int __byte_perm(unsigned int x, unsigned int y, unsigned int s); __device__ unsigned int __clz(int x); __device__ unsigned int __clzll(long long int x); @@ -448,41 +313,36 @@ __device__ static unsigned int __urhadd(unsigned int x, unsigned int y); __device__ static unsigned int __usad(unsigned int x, unsigned int y, unsigned int z); __device__ static inline unsigned int __hadd(int x, int y) { - int z = x + y; - int sign = z & 0x8000000; - int value = z & 0x7FFFFFFF; - return ((value) >> 1 || sign); -} -__device__ static inline int __mul24(int x, int y) { - return __hip_hc_ir_mul24_int(x, y); -} -__device__ static inline int __mulhi(int x, int y) { - return __hip_hc_ir_mulhi_int(x, y); + int z = x + y; + int sign = z & 0x8000000; + int value = z & 0x7FFFFFFF; + return ((value) >> 1 || sign); } +__device__ static inline int __mul24(int x, int y) { return __hip_hc_ir_mul24_int(x, y); } +__device__ static inline int __mulhi(int x, int y) { return __hip_hc_ir_mulhi_int(x, y); } __device__ static inline int __rhadd(int x, int y) { - int z = x + y + 1; - int sign = z & 0x8000000; - int value = z & 0x7FFFFFFF; - return ((value) >> 1 || sign); + int z = x + y + 1; + int sign = z & 0x8000000; + int value = z & 0x7FFFFFFF; + return ((value) >> 1 || sign); } __device__ static inline unsigned int __sad(int x, int y, int z) { - return x > y ? x - y + z : y - x + z; + return x > y ? x - y + z : y - x + z; } __device__ static inline unsigned int __uhadd(unsigned int x, unsigned int y) { - return (x + y) >> 1; + return (x + y) >> 1; } __device__ static inline int __umul24(unsigned int x, unsigned int y) { - return __hip_hc_ir_umul24_int(x, y); + return __hip_hc_ir_umul24_int(x, y); } __device__ static inline unsigned int __umulhi(unsigned int x, unsigned int y) { - return __hip_hc_ir_umulhi_int(x, y); + return __hip_hc_ir_umulhi_int(x, y); } __device__ static inline unsigned int __urhadd(unsigned int x, unsigned int y) { - return (x + y + 1) >> 1; + return (x + y + 1) >> 1; } -__device__ static inline unsigned int __usad(unsigned int x, unsigned int y, unsigned int z) -{ - return __hip_hc_ir_usad_int(x, y, z); +__device__ static inline unsigned int __usad(unsigned int x, unsigned int y, unsigned int z) { + return __hip_hc_ir_usad_int(x, y, z); } /* diff --git a/hipamd/include/hip/hcc_detail/driver_types.h b/hipamd/include/hip/hcc_detail/driver_types.h index b1e83139b8..a0d2e5bd77 100644 --- a/hipamd/include/hip/hcc_detail/driver_types.h +++ b/hipamd/include/hip/hcc_detail/driver_types.h @@ -24,16 +24,14 @@ THE SOFTWARE. #define HIP_INCLUDE_HIP_HCC_DETAIL_DRIVER_TYPES_H typedef void* hipDeviceptr_t; -enum hipChannelFormatKind -{ +enum hipChannelFormatKind { hipChannelFormatKindSigned = 0, hipChannelFormatKindUnsigned = 1, hipChannelFormatKindFloat = 2, hipChannelFormatKindNone = 3 }; -struct hipChannelFormatDesc -{ +struct hipChannelFormatDesc { int x; int y; int z; @@ -45,8 +43,7 @@ struct hipChannelFormatDesc #define HIP_TRSF_READ_AS_INTEGER 0x01 #define HIP_TRSA_OVERRIDE_FORMAT 0x01 -enum hipArray_Format -{ +enum hipArray_Format { HIP_AD_FORMAT_UNSIGNED_INT8 = 0x01, HIP_AD_FORMAT_UNSIGNED_INT16 = 0x02, HIP_AD_FORMAT_UNSIGNED_INT32 = 0x03, @@ -58,16 +55,16 @@ enum hipArray_Format }; struct HIP_ARRAY_DESCRIPTOR { - enum hipArray_Format format; - unsigned int numChannels; - size_t width; - size_t height; + enum hipArray_Format format; + unsigned int numChannels; + size_t width; + size_t height; unsigned int flags; size_t depth; }; struct hipArray { - void* data; //FIXME: generalize this + void* data; // FIXME: generalize this struct hipChannelFormatDesc desc; unsigned int type; unsigned int width; @@ -79,23 +76,23 @@ struct hipArray { }; typedef struct hip_Memcpy2D { - size_t height; - size_t widthInBytes; + size_t height; + size_t widthInBytes; hipArray* dstArray; hipDeviceptr_t dstDevice; - void * dstHost; + void* dstHost; hipMemoryType dstMemoryType; - size_t dstPitch; - size_t dstXInBytes; - size_t dstY; + size_t dstPitch; + size_t dstXInBytes; + size_t dstY; hipArray* srcArray; hipDeviceptr_t srcDevice; - const void * srcHost; + const void* srcHost; hipMemoryType srcMemoryType; - size_t srcPitch; - size_t srcXInBytes; - size_t srcY; -}hip_Memcpy2D; + size_t srcPitch; + size_t srcXInBytes; + size_t srcY; +} hip_Memcpy2D; typedef struct hipArray* hipArray_t; @@ -104,68 +101,66 @@ typedef const struct hipArray* hipArray_const_t; // TODO: It needs to be modified since it was just copied from hipArray. struct hipMipmappedArray { - void* data; //FIXME: generalize this + void* data; // FIXME: generalize this struct hipChannelFormatDesc desc; unsigned int width; unsigned int height; unsigned int depth; }; -typedef struct hipMipmappedArray *hipMipmappedArray_t; +typedef struct hipMipmappedArray* hipMipmappedArray_t; -typedef const struct hipMipmappedArray *hipMipmappedArray_const_t; +typedef const struct hipMipmappedArray* hipMipmappedArray_const_t; /** * hip resource types */ -enum hipResourceType -{ - hipResourceTypeArray = 0x00, +enum hipResourceType { + hipResourceTypeArray = 0x00, hipResourceTypeMipmappedArray = 0x01, - hipResourceTypeLinear = 0x02, - hipResourceTypePitch2D = 0x03 + hipResourceTypeLinear = 0x02, + hipResourceTypePitch2D = 0x03 }; /** * hip texture resource view formats */ -enum hipResourceViewFormat -{ - hipResViewFormatNone = 0x00, - hipResViewFormatUnsignedChar1 = 0x01, - hipResViewFormatUnsignedChar2 = 0x02, - hipResViewFormatUnsignedChar4 = 0x03, - hipResViewFormatSignedChar1 = 0x04, - hipResViewFormatSignedChar2 = 0x05, - hipResViewFormatSignedChar4 = 0x06, - hipResViewFormatUnsignedShort1 = 0x07, - hipResViewFormatUnsignedShort2 = 0x08, - hipResViewFormatUnsignedShort4 = 0x09, - hipResViewFormatSignedShort1 = 0x0a, - hipResViewFormatSignedShort2 = 0x0b, - hipResViewFormatSignedShort4 = 0x0c, - hipResViewFormatUnsignedInt1 = 0x0d, - hipResViewFormatUnsignedInt2 = 0x0e, - hipResViewFormatUnsignedInt4 = 0x0f, - hipResViewFormatSignedInt1 = 0x10, - hipResViewFormatSignedInt2 = 0x11, - hipResViewFormatSignedInt4 = 0x12, - hipResViewFormatHalf1 = 0x13, - hipResViewFormatHalf2 = 0x14, - hipResViewFormatHalf4 = 0x15, - hipResViewFormatFloat1 = 0x16, - hipResViewFormatFloat2 = 0x17, - hipResViewFormatFloat4 = 0x18, - hipResViewFormatUnsignedBlockCompressed1 = 0x19, - hipResViewFormatUnsignedBlockCompressed2 = 0x1a, - hipResViewFormatUnsignedBlockCompressed3 = 0x1b, - hipResViewFormatUnsignedBlockCompressed4 = 0x1c, - hipResViewFormatSignedBlockCompressed4 = 0x1d, - hipResViewFormatUnsignedBlockCompressed5 = 0x1e, - hipResViewFormatSignedBlockCompressed5 = 0x1f, +enum hipResourceViewFormat { + hipResViewFormatNone = 0x00, + hipResViewFormatUnsignedChar1 = 0x01, + hipResViewFormatUnsignedChar2 = 0x02, + hipResViewFormatUnsignedChar4 = 0x03, + hipResViewFormatSignedChar1 = 0x04, + hipResViewFormatSignedChar2 = 0x05, + hipResViewFormatSignedChar4 = 0x06, + hipResViewFormatUnsignedShort1 = 0x07, + hipResViewFormatUnsignedShort2 = 0x08, + hipResViewFormatUnsignedShort4 = 0x09, + hipResViewFormatSignedShort1 = 0x0a, + hipResViewFormatSignedShort2 = 0x0b, + hipResViewFormatSignedShort4 = 0x0c, + hipResViewFormatUnsignedInt1 = 0x0d, + hipResViewFormatUnsignedInt2 = 0x0e, + hipResViewFormatUnsignedInt4 = 0x0f, + hipResViewFormatSignedInt1 = 0x10, + hipResViewFormatSignedInt2 = 0x11, + hipResViewFormatSignedInt4 = 0x12, + hipResViewFormatHalf1 = 0x13, + hipResViewFormatHalf2 = 0x14, + hipResViewFormatHalf4 = 0x15, + hipResViewFormatFloat1 = 0x16, + hipResViewFormatFloat2 = 0x17, + hipResViewFormatFloat4 = 0x18, + hipResViewFormatUnsignedBlockCompressed1 = 0x19, + hipResViewFormatUnsignedBlockCompressed2 = 0x1a, + hipResViewFormatUnsignedBlockCompressed3 = 0x1b, + hipResViewFormatUnsignedBlockCompressed4 = 0x1c, + hipResViewFormatSignedBlockCompressed4 = 0x1d, + hipResViewFormatUnsignedBlockCompressed5 = 0x1e, + hipResViewFormatSignedBlockCompressed5 = 0x1f, hipResViewFormatUnsignedBlockCompressed6H = 0x20, - hipResViewFormatSignedBlockCompressed6H = 0x21, - hipResViewFormatUnsignedBlockCompressed7 = 0x22 + hipResViewFormatSignedBlockCompressed6H = 0x21, + hipResViewFormatUnsignedBlockCompressed7 = 0x22 }; /** @@ -182,12 +177,12 @@ struct hipResourceDesc { hipMipmappedArray_t mipmap; } mipmap; struct { - void *devPtr; + void* devPtr; struct hipChannelFormatDesc desc; size_t sizeInBytes; } linear; struct { - void *devPtr; + void* devPtr; struct hipChannelFormatDesc desc; size_t width; size_t height; @@ -199,16 +194,15 @@ struct hipResourceDesc { /** * hip resource view descriptor */ -struct hipResourceViewDesc -{ +struct hipResourceViewDesc { enum hipResourceViewFormat format; - size_t width; - size_t height; - size_t depth; - unsigned int firstMipmapLevel; - unsigned int lastMipmapLevel; - unsigned int firstLayer; - unsigned int lastLayer; + size_t width; + size_t height; + size_t depth; + unsigned int firstMipmapLevel; + unsigned int lastMipmapLevel; + unsigned int firstLayer; + unsigned int lastLayer; }; /** @@ -216,23 +210,24 @@ struct hipResourceViewDesc * */ typedef enum hipMemcpyKind { - hipMemcpyHostToHost = 0, ///< Host-to-Host Copy - hipMemcpyHostToDevice = 1, ///< Host-to-Device Copy - hipMemcpyDeviceToHost = 2, ///< Device-to-Host Copy - hipMemcpyDeviceToDevice =3, ///< Device-to-Device Copy - hipMemcpyDefault = 4 ///< Runtime will automatically determine copy-kind based on virtual addresses. + hipMemcpyHostToHost = 0, ///< Host-to-Host Copy + hipMemcpyHostToDevice = 1, ///< Host-to-Device Copy + hipMemcpyDeviceToHost = 2, ///< Device-to-Host Copy + hipMemcpyDeviceToDevice = 3, ///< Device-to-Device Copy + hipMemcpyDefault = + 4 ///< Runtime will automatically determine copy-kind based on virtual addresses. } hipMemcpyKind; -struct hipPitchedPtr -{ - void *ptr; - size_t pitch; - size_t xsize; - size_t ysize; +struct hipPitchedPtr { + void* ptr; + size_t pitch; + size_t xsize; + size_t ysize; }; struct hipExtent { - size_t width; // Width in elements when referring to array memory, in bytes when referring to linear memory + size_t width; // Width in elements when referring to array memory, in bytes when referring to + // linear memory size_t height; size_t depth; }; @@ -244,74 +239,72 @@ struct hipPos { }; struct hipMemcpy3DParms { - hipArray_t srcArray; - struct hipPos srcPos; - struct hipPitchedPtr srcPtr; + hipArray_t srcArray; + struct hipPos srcPos; + struct hipPitchedPtr srcPtr; - hipArray_t dstArray; - struct hipPos dstPos; - struct hipPitchedPtr dstPtr; + hipArray_t dstArray; + struct hipPos dstPos; + struct hipPitchedPtr dstPtr; - struct hipExtent extent; - enum hipMemcpyKind kind; - - size_t Depth; - size_t Height; - size_t WidthInBytes; - hipDeviceptr_t dstDevice; - size_t dstHeight; - void * dstHost; - size_t dstLOD; - hipMemoryType dstMemoryType; - size_t dstPitch; - size_t dstXInBytes; - size_t dstY; - size_t dstZ; - void * reserved0; - void * reserved1; - hipDeviceptr_t srcDevice; - size_t srcHeight; - const void * srcHost; - size_t srcLOD; - hipMemoryType srcMemoryType; - size_t srcPitch; - size_t srcXInBytes; - size_t srcY; - size_t srcZ; + struct hipExtent extent; + enum hipMemcpyKind kind; + + size_t Depth; + size_t Height; + size_t WidthInBytes; + hipDeviceptr_t dstDevice; + size_t dstHeight; + void* dstHost; + size_t dstLOD; + hipMemoryType dstMemoryType; + size_t dstPitch; + size_t dstXInBytes; + size_t dstY; + size_t dstZ; + void* reserved0; + void* reserved1; + hipDeviceptr_t srcDevice; + size_t srcHeight; + const void* srcHost; + size_t srcLOD; + hipMemoryType srcMemoryType; + size_t srcPitch; + size_t srcXInBytes; + size_t srcY; + size_t srcZ; }; -static __inline__ struct hipPitchedPtr make_hipPitchedPtr(void *d, size_t p, size_t xsz, size_t ysz) -{ - struct hipPitchedPtr s; +static __inline__ struct hipPitchedPtr make_hipPitchedPtr(void* d, size_t p, size_t xsz, + size_t ysz) { + struct hipPitchedPtr s; - s.ptr = d; - s.pitch = p; - s.xsize = xsz; - s.ysize = ysz; + s.ptr = d; + s.pitch = p; + s.xsize = xsz; + s.ysize = ysz; - return s; + return s; } -static __inline__ struct hipPos make_hipPos(size_t x, size_t y, size_t z) -{ - struct hipPos p; +static __inline__ struct hipPos make_hipPos(size_t x, size_t y, size_t z) { + struct hipPos p; - p.x = x; - p.y = y; - p.z = z; + p.x = x; + p.y = y; + p.z = z; - return p; + return p; } -static __inline__ struct hipExtent make_hipExtent(size_t w, size_t h, size_t d) -{ - struct hipExtent e; +static __inline__ struct hipExtent make_hipExtent(size_t w, size_t h, size_t d) { + struct hipExtent e; - e.width = w; - e.height = h; - e.depth = d; + e.width = w; + e.height = h; + e.depth = d; - return e; + return e; } #endif diff --git a/hipamd/include/hip/hcc_detail/functional_grid_launch.hpp b/hipamd/include/hip/hcc_detail/functional_grid_launch.hpp index bbffae52e8..de943f310d 100644 --- a/hipamd/include/hip/hcc_detail/functional_grid_launch.hpp +++ b/hipamd/include/hip/hcc_detail/functional_grid_launch.hpp @@ -44,116 +44,60 @@ THE SOFTWARE. #include #include -namespace hip_impl -{ - template< - typename T, - typename std::enable_if{}>::type* = nullptr> - inline - T round_up_to_next_multiple_nonnegative(T x, T y) - { - T tmp = x + y - 1; - return tmp - tmp % y; - } +namespace hip_impl { +template {}>::type* = nullptr> +inline T round_up_to_next_multiple_nonnegative(T x, T y) { + T tmp = x + y - 1; + return tmp - tmp % y; +} - inline - std::vector make_kernarg() - { - return {}; - } +inline std::vector make_kernarg() { return {}; } - inline - std::vector make_kernarg(std::vector kernarg) - { - return kernarg; - } +inline std::vector make_kernarg(std::vector kernarg) { return kernarg; } - template - inline - std::vector make_kernarg(std::vector kernarg, T x) - { - kernarg.resize( - round_up_to_next_multiple_nonnegative(kernarg.size(), alignof(T)) + - sizeof(T)); +template +inline std::vector make_kernarg(std::vector kernarg, T x) { + kernarg.resize(round_up_to_next_multiple_nonnegative(kernarg.size(), alignof(T)) + sizeof(T)); - new (kernarg.data() + kernarg.size() - sizeof(T)) T{std::move(x)}; + new (kernarg.data() + kernarg.size() - sizeof(T)) T{std::move(x)}; - return kernarg; - } + return kernarg; +} - template - inline - std::vector make_kernarg( - std::vector kernarg, T x, Ts... xs) - { - return make_kernarg( - make_kernarg(std::move(kernarg), std::move(x)), std::move(xs)...); - } +template +inline std::vector make_kernarg(std::vector kernarg, T x, Ts... xs) { + return make_kernarg(make_kernarg(std::move(kernarg), std::move(x)), std::move(xs)...); +} - template - inline - std::vector make_kernarg(Ts... xs) - { - std::vector kernarg; - kernarg.reserve(sizeof(std::tuple)); +template +inline std::vector make_kernarg(Ts... xs) { + std::vector kernarg; + kernarg.reserve(sizeof(std::tuple)); - return make_kernarg(std::move(kernarg), std::move(xs)...); - } + return make_kernarg(std::move(kernarg), std::move(xs)...); +} - void hipLaunchKernelGGLImpl( - std::uintptr_t function_address, - const dim3& numBlocks, - const dim3& dimBlocks, - std::uint32_t sharedMemBytes, - hipStream_t stream, - void** kernarg); -} // Namespace hip_impl. +void hipLaunchKernelGGLImpl(std::uintptr_t function_address, const dim3& numBlocks, + const dim3& dimBlocks, std::uint32_t sharedMemBytes, hipStream_t stream, + void** kernarg); +} // Namespace hip_impl. -template -inline -void hipLaunchKernelGGL( - F kernel, - const dim3& numBlocks, - const dim3& dimBlocks, - std::uint32_t sharedMemBytes, - hipStream_t stream, - Args... args) -{ +template +inline void hipLaunchKernelGGL(F kernel, const dim3& numBlocks, const dim3& dimBlocks, + std::uint32_t sharedMemBytes, hipStream_t stream, Args... args) { auto kernarg = hip_impl::make_kernarg(std::move(args)...); std::size_t kernarg_size = kernarg.size(); - void* config[] = { - HIP_LAUNCH_PARAM_BUFFER_POINTER, kernarg.data(), - HIP_LAUNCH_PARAM_BUFFER_SIZE, &kernarg_size, - HIP_LAUNCH_PARAM_END - }; + void* config[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, kernarg.data(), HIP_LAUNCH_PARAM_BUFFER_SIZE, + &kernarg_size, HIP_LAUNCH_PARAM_END}; - hip_impl::hipLaunchKernelGGLImpl( - reinterpret_cast(kernel), - numBlocks, - dimBlocks, - sharedMemBytes, - stream, - &config[0]); + hip_impl::hipLaunchKernelGGLImpl(reinterpret_cast(kernel), numBlocks, dimBlocks, + sharedMemBytes, stream, &config[0]); } -template -inline -void hipLaunchKernel( - F kernel, - const dim3& numBlocks, - const dim3& dimBlocks, - std::uint32_t groupMemBytes, - hipStream_t stream, - Args... args) -{ - hipLaunchKernelGGL( - kernel, - numBlocks, - dimBlocks, - groupMemBytes, - stream, - hipLaunchParm{}, - std::move(args)...); +template +inline void hipLaunchKernel(F kernel, const dim3& numBlocks, const dim3& dimBlocks, + std::uint32_t groupMemBytes, hipStream_t stream, Args... args) { + hipLaunchKernelGGL(kernel, numBlocks, dimBlocks, groupMemBytes, stream, hipLaunchParm{}, + std::move(args)...); } - diff --git a/hipamd/include/hip/hcc_detail/grid_launch_GGL.hpp b/hipamd/include/hip/hcc_detail/grid_launch_GGL.hpp index 95903436b6..1c05279e0b 100644 --- a/hipamd/include/hip/hcc_detail/grid_launch_GGL.hpp +++ b/hipamd/include/hip/hcc_detail/grid_launch_GGL.hpp @@ -22,9 +22,9 @@ THE SOFTWARE. #pragma once #if GENERIC_GRID_LAUNCH == 1 - #if __hcc_workweek__ >= 17481 - #include "functional_grid_launch.hpp" - #else - #include "macro_based_grid_launch.hpp" - #endif -#endif //GENERIC_GRID_LAUNCH \ No newline at end of file +#if __hcc_workweek__ >= 17481 +#include "functional_grid_launch.hpp" +#else +#include "macro_based_grid_launch.hpp" +#endif +#endif // GENERIC_GRID_LAUNCH \ No newline at end of file diff --git a/hipamd/include/hip/hcc_detail/helpers.hpp b/hipamd/include/hip/hcc_detail/helpers.hpp index b5502c1efb..1916945c1a 100644 --- a/hipamd/include/hip/hcc_detail/helpers.hpp +++ b/hipamd/include/hip/hcc_detail/helpers.hpp @@ -23,111 +23,88 @@ THE SOFTWARE. #pragma once #include "concepts.hpp" -#include // For std::conditional, std::decay, std::enable_if, - // std::false_type, std result_of and std::true_type. -#include // For std::declval. +#include // For std::conditional, std::decay, std::enable_if, + // std::false_type, std result_of and std::true_type. +#include // For std::declval. -namespace std -{ // TODO: these should be removed as soon as possible. - #if (__cplusplus < 201406L) - #if (__cplusplus < 201402L) - template - using enable_if_t = typename enable_if::type; - template - using conditional_t = typename conditional::type; - template - using decay_t = typename decay::type; - template - using result_of_t = typename result_of::type; - template - using remove_reference_t = typename remove_reference::type; - #endif - #endif -} +namespace std { // TODO: these should be removed as soon as possible. +#if (__cplusplus < 201406L) +#if (__cplusplus < 201402L) +template +using enable_if_t = typename enable_if::type; +template +using conditional_t = typename conditional::type; +template +using decay_t = typename decay::type; +template +using result_of_t = typename result_of::type; +template +using remove_reference_t = typename remove_reference::type; +#endif +#endif +} // namespace std -namespace hip_impl -{ - template - using void_t_ = void; +namespace hip_impl { +template +using void_t_ = void; - #if (__cplusplus < 201402L) - template< - FunctionalProcedure F, - unsigned int n = 0u, - typename = void> - struct is_callable_impl : is_callable_impl {}; +#if (__cplusplus < 201402L) +template +struct is_callable_impl : is_callable_impl {}; - // Pointer to member function, call through non-pointer. - template - struct is_callable_impl< - F(C, Ts...), - 0u, - void_t_().*std::declval())( - std::declval()...))> - > : std::true_type {}; +// Pointer to member function, call through non-pointer. +template +struct is_callable_impl< + F(C, Ts...), 0u, + void_t_().*std::declval())(std::declval()...))> > + : std::true_type {}; - // Pointer to member function, call through pointer. - template - struct is_callable_impl< - F(C, Ts...), - 1u, - void_t_()).*std::declval())( - std::declval()...))> - > : std::true_type {}; +// Pointer to member function, call through pointer. +template +struct is_callable_impl< + F(C, Ts...), 1u, + void_t_()).*std::declval())(std::declval()...))> > + : std::true_type {}; - // Pointer to member data, call through non-pointer, no args. - template - struct is_callable_impl< - F(C), - 2u, - void_t_().*std::declval())> - > : std::true_type {}; +// Pointer to member data, call through non-pointer, no args. +template +struct is_callable_impl().*std::declval())> > + : std::true_type {}; - // Pointer to member data, call through pointer, no args. - template - struct is_callable_impl< - F(C), - 3u, - void_t_().*std::declval())> - > : std::true_type {}; +// Pointer to member data, call through pointer, no args. +template +struct is_callable_impl().*std::declval())> > + : std::true_type {}; - // General call, n args. - template - struct is_callable_impl< - F(Ts...), - 4u, - void_t_()(std::declval()...))> - > : std::true_type {}; +// General call, n args. +template +struct is_callable_impl()(std::declval()...))> > + : std::true_type {}; - // Not callable. - template - struct is_callable_impl : std::false_type {}; - #else - template - struct is_callable_impl : std::false_type {}; +// Not callable. +template +struct is_callable_impl : std::false_type {}; +#else +template +struct is_callable_impl : std::false_type {}; - template - struct is_callable_impl< - F(Ts...), - void_t_>> : std::true_type {}; - #endif - template - struct is_callable : is_callable_impl {}; +template +struct is_callable_impl > > : std::true_type {}; +#endif +template +struct is_callable : is_callable_impl {}; - #define count_macro_args_impl_hip_(\ - _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15,\ - _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29,\ - _30, _31, _n, ...)\ - _n - #define count_macro_args_hip_(...)\ - count_macro_args_impl_hip_(\ - , ##__VA_ARGS__, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19,\ - 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +#define count_macro_args_impl_hip_(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, \ + _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, \ + _26, _27, _28, _29, _30, _31, _n, ...) \ + _n +#define count_macro_args_hip_(...) \ + count_macro_args_impl_hip_(, ##__VA_ARGS__, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, \ + 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, \ + 0) - #define overloaded_macro_expand_hip_(macro, arg_cnt) macro##arg_cnt - #define overload_macro_impl_hip_(macro, arg_cnt)\ - overloaded_macro_expand_hip_(macro, arg_cnt) - #define overload_macro_hip_(macro, ...)\ - overload_macro_impl_hip_(macro, count_macro_args_hip_(__VA_ARGS__))\ - (__VA_ARGS__) -} +#define overloaded_macro_expand_hip_(macro, arg_cnt) macro##arg_cnt +#define overload_macro_impl_hip_(macro, arg_cnt) overloaded_macro_expand_hip_(macro, arg_cnt) +#define overload_macro_hip_(macro, ...) \ + overload_macro_impl_hip_(macro, count_macro_args_hip_(__VA_ARGS__))(__VA_ARGS__) +} // namespace hip_impl diff --git a/hipamd/include/hip/hcc_detail/hip_complex.h b/hipamd/include/hip/hcc_detail/hip_complex.h index c76d65b058..973d5f564b 100644 --- a/hipamd/include/hip/hcc_detail/hip_complex.h +++ b/hipamd/include/hip/hcc_detail/hip_complex.h @@ -27,79 +27,79 @@ THE SOFTWARE. #include #if __cplusplus -#define COMPLEX_ADD_OP_OVERLOAD(type) \ -__device__ __host__ static inline type operator + (const type& lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs.x + rhs.x ; \ - ret.y = lhs.y + rhs.y ; \ - return ret; \ -} +#define COMPLEX_ADD_OP_OVERLOAD(type) \ + __device__ __host__ static inline type operator+(const type& lhs, const type& rhs) { \ + type ret; \ + ret.x = lhs.x + rhs.x; \ + ret.y = lhs.y + rhs.y; \ + return ret; \ + } -#define COMPLEX_SUB_OP_OVERLOAD(type) \ -__device__ __host__ static inline type operator - (const type& lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs.x - rhs.x; \ - ret.y = lhs.y - rhs.y; \ - return ret; \ -} +#define COMPLEX_SUB_OP_OVERLOAD(type) \ + __device__ __host__ static inline type operator-(const type& lhs, const type& rhs) { \ + type ret; \ + ret.x = lhs.x - rhs.x; \ + ret.y = lhs.y - rhs.y; \ + return ret; \ + } -#define COMPLEX_MUL_OP_OVERLOAD(type) \ -__device__ __host__ static inline type operator * (const type& lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs.x * rhs.x - lhs.y * rhs.y; \ - ret.y = lhs.x * rhs.y + lhs.y * rhs.x; \ - return ret; \ -} +#define COMPLEX_MUL_OP_OVERLOAD(type) \ + __device__ __host__ static inline type operator*(const type& lhs, const type& rhs) { \ + type ret; \ + ret.x = lhs.x * rhs.x - lhs.y * rhs.y; \ + ret.y = lhs.x * rhs.y + lhs.y * rhs.x; \ + return ret; \ + } -#define COMPLEX_DIV_OP_OVERLOAD(type) \ -__device__ __host__ static inline type operator / (const type& lhs, const type& rhs) { \ - type ret; \ - ret.x = (lhs.x * rhs.x + lhs.y * rhs.y); \ - ret.y = (rhs.x * lhs.y - lhs.x * rhs.y); \ - ret.x = ret.x / (rhs.x * rhs.x + rhs.y * rhs.y); \ - ret.y = ret.y / (rhs.x * rhs.x + rhs.y * rhs.y); \ - return ret; \ -} +#define COMPLEX_DIV_OP_OVERLOAD(type) \ + __device__ __host__ static inline type operator/(const type& lhs, const type& rhs) { \ + type ret; \ + ret.x = (lhs.x * rhs.x + lhs.y * rhs.y); \ + ret.y = (rhs.x * lhs.y - lhs.x * rhs.y); \ + ret.x = ret.x / (rhs.x * rhs.x + rhs.y * rhs.y); \ + ret.y = ret.y / (rhs.x * rhs.x + rhs.y * rhs.y); \ + return ret; \ + } -#define COMPLEX_ADD_PREOP_OVERLOAD(type) \ -__device__ __host__ static inline type& operator += (type& lhs, const type& rhs) { \ - lhs.x += rhs.x; \ - lhs.y += rhs.y; \ - return lhs; \ -} +#define COMPLEX_ADD_PREOP_OVERLOAD(type) \ + __device__ __host__ static inline type& operator+=(type& lhs, const type& rhs) { \ + lhs.x += rhs.x; \ + lhs.y += rhs.y; \ + return lhs; \ + } -#define COMPLEX_SUB_PREOP_OVERLOAD(type) \ -__device__ __host__ static inline type& operator -= (type& lhs, const type& rhs) { \ - lhs.x -= rhs.x; \ - lhs.y -= rhs.y; \ - return lhs; \ -} +#define COMPLEX_SUB_PREOP_OVERLOAD(type) \ + __device__ __host__ static inline type& operator-=(type& lhs, const type& rhs) { \ + lhs.x -= rhs.x; \ + lhs.y -= rhs.y; \ + return lhs; \ + } -#define COMPLEX_MUL_PREOP_OVERLOAD(type) \ -__device__ __host__ static inline type& operator *= (type& lhs, const type& rhs) { \ - lhs = lhs * rhs; \ - return lhs; \ -} +#define COMPLEX_MUL_PREOP_OVERLOAD(type) \ + __device__ __host__ static inline type& operator*=(type& lhs, const type& rhs) { \ + lhs = lhs * rhs; \ + return lhs; \ + } -#define COMPLEX_DIV_PREOP_OVERLOAD(type) \ -__device__ __host__ static inline type& operator /= (type& lhs, const type& rhs) { \ - lhs = lhs / rhs; \ - return lhs; \ -} +#define COMPLEX_DIV_PREOP_OVERLOAD(type) \ + __device__ __host__ static inline type& operator/=(type& lhs, const type& rhs) { \ + lhs = lhs / rhs; \ + return lhs; \ + } -#define COMPLEX_SCALAR_PRODUCT(type, type1) \ -__device__ __host__ static inline type operator * (const type& lhs, type1 rhs) { \ - type ret; \ - ret.x = lhs.x * rhs; \ - ret.y = lhs.y * rhs; \ - return ret; \ -} +#define COMPLEX_SCALAR_PRODUCT(type, type1) \ + __device__ __host__ static inline type operator*(const type& lhs, type1 rhs) { \ + type ret; \ + ret.x = lhs.x * rhs; \ + ret.y = lhs.y * rhs; \ + return ret; \ + } #endif struct hipFloatComplex { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: __device__ __host__ hipFloatComplex() : x(0.0f), y(0.0f) {} __device__ __host__ hipFloatComplex(float x) : x(x), y(0.0f) {} __device__ __host__ hipFloatComplex(float x, float y) : x(x), y(y) {} @@ -112,27 +112,27 @@ struct hipFloatComplex { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipFloatComplex, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipFloatComplex, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipFloatComplex, signed long long) - #endif - float x, y; +#endif + float x, y; } __attribute__((aligned(8))); struct hipDoubleComplex { - #ifdef __cplusplus - public: - __device__ __host__ hipDoubleComplex() : x(0.0f), y(0.0f) {} - __device__ __host__ hipDoubleComplex(double x) : x(x), y(0.0f) {} - __device__ __host__ hipDoubleComplex(double x, double y) : x(x), y(y) {} - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, unsigned short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, signed short) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, unsigned int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, signed int) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, float) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, unsigned long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, signed long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, unsigned long long) - MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, signed long long) - #endif - double x, y; +#ifdef __cplusplus + public: + __device__ __host__ hipDoubleComplex() : x(0.0f), y(0.0f) {} + __device__ __host__ hipDoubleComplex(double x) : x(x), y(0.0f) {} + __device__ __host__ hipDoubleComplex(double x, double y) : x(x), y(y) {} + MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, unsigned short) + MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, signed short) + MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, unsigned int) + MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, signed int) + MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, float) + MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, unsigned long) + MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, signed long) + MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, unsigned long long) + MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(hipDoubleComplex, signed long long) +#endif + double x, y; } __attribute__((aligned(16))); #if __cplusplus @@ -177,126 +177,110 @@ COMPLEX_SCALAR_PRODUCT(hipDoubleComplex, unsigned long long) #endif -__device__ __host__ static inline float hipCrealf(hipFloatComplex z){ - return z.x; -} +__device__ __host__ static inline float hipCrealf(hipFloatComplex z) { return z.x; } -__device__ __host__ static inline float hipCimagf(hipFloatComplex z){ - return z.y; -} +__device__ __host__ static inline float hipCimagf(hipFloatComplex z) { return z.y; } -__device__ __host__ static inline hipFloatComplex make_hipFloatComplex(float a, float b){ +__device__ __host__ static inline hipFloatComplex make_hipFloatComplex(float a, float b) { hipFloatComplex z; z.x = a; z.y = b; return z; } -__device__ __host__ static inline hipFloatComplex hipConjf(hipFloatComplex z){ +__device__ __host__ static inline hipFloatComplex hipConjf(hipFloatComplex z) { hipFloatComplex ret; ret.x = z.x; ret.y = -z.y; return ret; } -__device__ __host__ static inline float hipCsqabsf(hipFloatComplex z){ +__device__ __host__ static inline float hipCsqabsf(hipFloatComplex z) { return z.x * z.x + z.y * z.y; } -__device__ __host__ static inline hipFloatComplex hipCaddf(hipFloatComplex p, hipFloatComplex q){ +__device__ __host__ static inline hipFloatComplex hipCaddf(hipFloatComplex p, hipFloatComplex q) { return make_hipFloatComplex(p.x + q.x, p.y + q.y); } -__device__ __host__ static inline hipFloatComplex hipCsubf(hipFloatComplex p, hipFloatComplex q){ +__device__ __host__ static inline hipFloatComplex hipCsubf(hipFloatComplex p, hipFloatComplex q) { return make_hipFloatComplex(p.x - q.x, p.y - q.y); } -__device__ __host__ static inline hipFloatComplex hipCmulf(hipFloatComplex p, hipFloatComplex q){ +__device__ __host__ static inline hipFloatComplex hipCmulf(hipFloatComplex p, hipFloatComplex q) { return make_hipFloatComplex(p.x * q.x - p.y * q.y, p.y * q.x + p.x * q.y); } -__device__ __host__ static inline hipFloatComplex hipCdivf(hipFloatComplex p, hipFloatComplex q){ +__device__ __host__ static inline hipFloatComplex hipCdivf(hipFloatComplex p, hipFloatComplex q) { float sqabs = hipCsqabsf(q); hipFloatComplex ret; - ret.x = (p.x * q.x + p.y * q.y)/sqabs; - ret.y = (p.y * q.x - p.x * q.y)/sqabs; + ret.x = (p.x * q.x + p.y * q.y) / sqabs; + ret.y = (p.y * q.x - p.x * q.y) / sqabs; return ret; } -__device__ __host__ static inline float hipCabsf(hipFloatComplex z){ - return sqrtf(hipCsqabsf(z)); -} +__device__ __host__ static inline float hipCabsf(hipFloatComplex z) { return sqrtf(hipCsqabsf(z)); } +__device__ __host__ static inline double hipCreal(hipDoubleComplex z) { return z.x; } -__device__ __host__ static inline double hipCreal(hipDoubleComplex z){ - return z.x; -} +__device__ __host__ static inline double hipCimag(hipDoubleComplex z) { return z.y; } -__device__ __host__ static inline double hipCimag(hipDoubleComplex z){ - return z.y; -} - -__device__ __host__ static inline hipDoubleComplex make_hipDoubleComplex(double a, double b){ +__device__ __host__ static inline hipDoubleComplex make_hipDoubleComplex(double a, double b) { hipDoubleComplex z; z.x = a; z.y = b; return z; } -__device__ __host__ static inline hipDoubleComplex hipConj(hipDoubleComplex z){ +__device__ __host__ static inline hipDoubleComplex hipConj(hipDoubleComplex z) { hipDoubleComplex ret; ret.x = z.x; ret.y = z.y; return ret; } -__device__ __host__ static inline double hipCsqabs(hipDoubleComplex z){ +__device__ __host__ static inline double hipCsqabs(hipDoubleComplex z) { return z.x * z.x + z.y * z.y; } -__device__ __host__ static inline hipDoubleComplex hipCadd(hipDoubleComplex p, hipDoubleComplex q){ +__device__ __host__ static inline hipDoubleComplex hipCadd(hipDoubleComplex p, hipDoubleComplex q) { return make_hipDoubleComplex(p.x + q.x, p.y + q.y); } -__device__ __host__ static inline hipDoubleComplex hipCsub(hipDoubleComplex p, hipDoubleComplex q){ +__device__ __host__ static inline hipDoubleComplex hipCsub(hipDoubleComplex p, hipDoubleComplex q) { return make_hipDoubleComplex(p.x - q.x, p.y - q.y); } -__device__ __host__ static inline hipDoubleComplex hipCmul(hipDoubleComplex p, hipDoubleComplex q){ +__device__ __host__ static inline hipDoubleComplex hipCmul(hipDoubleComplex p, hipDoubleComplex q) { return make_hipDoubleComplex(p.x * q.x - p.y * q.y, p.y * q.x + p.x * q.y); } -__device__ __host__ static inline hipDoubleComplex hipCdiv(hipDoubleComplex p, hipDoubleComplex q){ +__device__ __host__ static inline hipDoubleComplex hipCdiv(hipDoubleComplex p, hipDoubleComplex q) { double sqabs = hipCsqabs(q); hipDoubleComplex ret; - ret.x = (p.x * q.x + p.y * q.y)/sqabs; - ret.y = (p.y * q.x - p.x * q.y)/sqabs; + ret.x = (p.x * q.x + p.y * q.y) / sqabs; + ret.y = (p.y * q.x - p.x * q.y) / sqabs; return ret; } -__device__ __host__ static inline double hipCabs(hipDoubleComplex z){ - return sqrtf(hipCsqabs(z)); -} +__device__ __host__ static inline double hipCabs(hipDoubleComplex z) { return sqrtf(hipCsqabs(z)); } typedef hipFloatComplex hipComplex; -__device__ __host__ static inline hipComplex make_hipComplex(float x, - float y){ +__device__ __host__ static inline hipComplex make_hipComplex(float x, float y) { return make_hipFloatComplex(x, y); } -__device__ __host__ static inline hipFloatComplex hipComplexDoubleToFloat -(hipDoubleComplex z){ +__device__ __host__ static inline hipFloatComplex hipComplexDoubleToFloat(hipDoubleComplex z) { return make_hipFloatComplex((float)z.x, (float)z.y); } -__device__ __host__ static inline hipDoubleComplex hipComplexFloatToDouble -(hipFloatComplex z){ +__device__ __host__ static inline hipDoubleComplex hipComplexFloatToDouble(hipFloatComplex z) { return make_hipDoubleComplex((double)z.x, (double)z.y); } -__device__ __host__ static inline hipComplex hipCfmaf(hipComplex p, hipComplex q, hipComplex r){ +__device__ __host__ static inline hipComplex hipCfmaf(hipComplex p, hipComplex q, hipComplex r) { float real = (p.x * q.x) + r.x; float imag = (q.x * p.y) + r.y; @@ -306,7 +290,8 @@ __device__ __host__ static inline hipComplex hipCfmaf(hipComplex p, hipComplex q return make_hipComplex(real, imag); } -__device__ __host__ static inline hipDoubleComplex hipCfma(hipDoubleComplex p, hipDoubleComplex q, hipDoubleComplex r){ +__device__ __host__ static inline hipDoubleComplex hipCfma(hipDoubleComplex p, hipDoubleComplex q, + hipDoubleComplex r) { float real = (p.x * q.x) + r.x; float imag = (q.x * p.y) + r.y; diff --git a/hipamd/include/hip/hcc_detail/hip_db.h b/hipamd/include/hip/hcc_detail/hip_db.h index eb5c3c0ac8..91ff54d3a1 100644 --- a/hipamd/include/hip/hcc_detail/hip_db.h +++ b/hipamd/include/hip/hcc_detail/hip_db.h @@ -10,10 +10,9 @@ * HIP maintains a table for all memory allocations performed by the application. * If targetAddress is 0, the entire table is printed to stderr. * If targetAddress is non-null, this routine will perform some forensic analysis - * to find the pointer + * to find the pointer */ -void hipdbPrintMem(void *targetAddress); - +void hipdbPrintMem(void* targetAddress); // doxygen end HipDb diff --git a/hipamd/include/hip/hcc_detail/hip_fp16.h b/hipamd/include/hip/hcc_detail/hip_fp16.h index 4d90ec82b2..fe8414ca87 100644 --- a/hipamd/include/hip/hcc_detail/hip_fp16.h +++ b/hipamd/include/hip/hcc_detail/hip_fp16.h @@ -24,7 +24,7 @@ THE SOFTWARE. #define HIP_INCLUDE_HIP_HCC_DETAIL_HIP_FP16_H #include "hip/hcc_detail/hip_vector_types.h" -#if ( __clang_major__ > 3) +#if (__clang_major__ > 3) typedef __fp16 __half; typedef __fp16 __half1 __attribute__((ext_vector_type(1))); typedef __fp16 __half2 __attribute__((ext_vector_type(2))); @@ -63,32 +63,32 @@ __device__ static __half2 h2div(__half2 a, __half2 b); Half Comparision Functions */ -__device__ bool __heq(__half a, __half b); -__device__ bool __hge(__half a, __half b); -__device__ bool __hgt(__half a, __half b); -__device__ bool __hisinf(__half a); -__device__ bool __hisnan(__half a); -__device__ bool __hle(__half a, __half b); -__device__ bool __hlt(__half a, __half b); -__device__ bool __hne(__half a, __half b); +__device__ bool __heq(__half a, __half b); +__device__ bool __hge(__half a, __half b); +__device__ bool __hgt(__half a, __half b); +__device__ bool __hisinf(__half a); +__device__ bool __hisnan(__half a); +__device__ bool __hle(__half a, __half b); +__device__ bool __hlt(__half a, __half b); +__device__ bool __hne(__half a, __half b); /* Half2 Comparision Functions */ -__device__ bool __hbeq2(__half2 a, __half2 b); -__device__ bool __hbge2(__half2 a, __half2 b); -__device__ bool __hbgt2(__half2 a, __half2 b); -__device__ bool __hble2(__half2 a, __half2 b); -__device__ bool __hblt2(__half2 a, __half2 b); -__device__ bool __hbne2(__half2 a, __half2 b); -__device__ __half2 __heq2(__half2 a, __half2 b); -__device__ __half2 __hge2(__half2 a, __half2 b); -__device__ __half2 __hgt2(__half2 a, __half2 b); -__device__ __half2 __hisnan2(__half2 a); -__device__ __half2 __hle2(__half2 a, __half2 b); -__device__ __half2 __hlt2(__half2 a, __half2 b); -__device__ __half2 __hne2(__half2 a, __half2 b); +__device__ bool __hbeq2(__half2 a, __half2 b); +__device__ bool __hbge2(__half2 a, __half2 b); +__device__ bool __hbgt2(__half2 a, __half2 b); +__device__ bool __hble2(__half2 a, __half2 b); +__device__ bool __hblt2(__half2 a, __half2 b); +__device__ bool __hbne2(__half2 a, __half2 b); +__device__ __half2 __heq2(__half2 a, __half2 b); +__device__ __half2 __hge2(__half2 a, __half2 b); +__device__ __half2 __hgt2(__half2 a, __half2 b); +__device__ __half2 __hisnan2(__half2 a); +__device__ __half2 __hle2(__half2 a, __half2 b); +__device__ __half2 __hlt2(__half2 a, __half2 b); +__device__ __half2 __hne2(__half2 a, __half2 b); /* Half Math Functions @@ -130,80 +130,80 @@ __device__ static __half2 h2sqrt(const __half2 h); Half Conversion And Data Movement */ -__device__ __half2 __float22half2_rn(const float2 a); -__device__ __half __float2half(const float a); -__device__ __half2 __float2half2_rn(const float a); -__device__ __half __float2half_rd(const float a); -__device__ __half __float2half_rn(const float a); -__device__ __half __float2half_ru(const float a); -__device__ __half __float2half_rz(const float a); -__device__ __half2 __floats2half2_rn(const float a, const float b); -__device__ float2 __half22float2(const __half2 a); -__device__ float __half2float(const __half a); -__device__ __half2 half2half2(const __half a); -__device__ int __half2int_rd(__half h); -__device__ int __half2int_rn(__half h); -__device__ int __half2int_ru(__half h); -__device__ int __half2int_rz(__half h); -__device__ long long int __half2ll_rd(__half h); -__device__ long long int __half2ll_rn(__half h); -__device__ long long int __half2ll_ru(__half h); -__device__ long long int __half2ll_rz(__half h); -__device__ short __half2short_rd(__half h); -__device__ short __half2short_rn(__half h); -__device__ short __half2short_ru(__half h); -__device__ short __half2short_rz(__half h); -__device__ unsigned int __half2uint_rd(__half h); -__device__ unsigned int __half2uint_rn(__half h); -__device__ unsigned int __half2uint_ru(__half h); -__device__ unsigned int __half2uint_rz(__half h); -__device__ unsigned long long int __half2ull_rd(__half h); -__device__ unsigned long long int __half2ull_rn(__half h); -__device__ unsigned long long int __half2ull_ru(__half h); -__device__ unsigned long long int __half2ull_rz(__half h); -__device__ unsigned short int __half2ushort_rd(__half h); -__device__ unsigned short int __half2ushort_rn(__half h); -__device__ unsigned short int __half2ushort_ru(__half h); -__device__ unsigned short int __half2ushort_rz(__half h); -__device__ short int __half_as_short(const __half h); -__device__ unsigned short int __half_as_ushort(const __half h); -__device__ __half2 __halves2half2(const __half a, const __half b); -__device__ float __high2float(const __half2 a); -__device__ __half __high2half(const __half2 a); -__device__ __half2 __high2half2(const __half2 a); -__device__ __half2 __highs2half2(const __half2 a, const __half2 b); -__device__ __half __int2half_rd(int i); -__device__ __half __int2half_rn(int i); -__device__ __half __int2half_ru(int i); -__device__ __half __int2half_rz(int i); -__device__ __half __ll2half_rd(long long int i); -__device__ __half __ll2half_rn(long long int i); -__device__ __half __ll2half_ru(long long int i); -__device__ __half __ll2half_rz(long long int i); -__device__ float __low2float(const __half2 a); +__device__ __half2 __float22half2_rn(const float2 a); +__device__ __half __float2half(const float a); +__device__ __half2 __float2half2_rn(const float a); +__device__ __half __float2half_rd(const float a); +__device__ __half __float2half_rn(const float a); +__device__ __half __float2half_ru(const float a); +__device__ __half __float2half_rz(const float a); +__device__ __half2 __floats2half2_rn(const float a, const float b); +__device__ float2 __half22float2(const __half2 a); +__device__ float __half2float(const __half a); +__device__ __half2 half2half2(const __half a); +__device__ int __half2int_rd(__half h); +__device__ int __half2int_rn(__half h); +__device__ int __half2int_ru(__half h); +__device__ int __half2int_rz(__half h); +__device__ long long int __half2ll_rd(__half h); +__device__ long long int __half2ll_rn(__half h); +__device__ long long int __half2ll_ru(__half h); +__device__ long long int __half2ll_rz(__half h); +__device__ short __half2short_rd(__half h); +__device__ short __half2short_rn(__half h); +__device__ short __half2short_ru(__half h); +__device__ short __half2short_rz(__half h); +__device__ unsigned int __half2uint_rd(__half h); +__device__ unsigned int __half2uint_rn(__half h); +__device__ unsigned int __half2uint_ru(__half h); +__device__ unsigned int __half2uint_rz(__half h); +__device__ unsigned long long int __half2ull_rd(__half h); +__device__ unsigned long long int __half2ull_rn(__half h); +__device__ unsigned long long int __half2ull_ru(__half h); +__device__ unsigned long long int __half2ull_rz(__half h); +__device__ unsigned short int __half2ushort_rd(__half h); +__device__ unsigned short int __half2ushort_rn(__half h); +__device__ unsigned short int __half2ushort_ru(__half h); +__device__ unsigned short int __half2ushort_rz(__half h); +__device__ short int __half_as_short(const __half h); +__device__ unsigned short int __half_as_ushort(const __half h); +__device__ __half2 __halves2half2(const __half a, const __half b); +__device__ float __high2float(const __half2 a); +__device__ __half __high2half(const __half2 a); +__device__ __half2 __high2half2(const __half2 a); +__device__ __half2 __highs2half2(const __half2 a, const __half2 b); +__device__ __half __int2half_rd(int i); +__device__ __half __int2half_rn(int i); +__device__ __half __int2half_ru(int i); +__device__ __half __int2half_rz(int i); +__device__ __half __ll2half_rd(long long int i); +__device__ __half __ll2half_rn(long long int i); +__device__ __half __ll2half_ru(long long int i); +__device__ __half __ll2half_rz(long long int i); +__device__ float __low2float(const __half2 a); __device__ __half __low2half(const __half2 a); __device__ __half2 __low2half2(const __half2 a, const __half2 b); __device__ __half2 __low2half2(const __half2 a); __device__ __half2 __lowhigh2highlow(const __half2 a); __device__ __half2 __lows2half2(const __half2 a, const __half2 b); -__device__ __half __short2half_rd(short int i); -__device__ __half __short2half_rn(short int i); -__device__ __half __short2half_ru(short int i); -__device__ __half __short2half_rz(short int i); -__device__ __half __uint2half_rd(unsigned int i); -__device__ __half __uint2half_rn(unsigned int i); -__device__ __half __uint2half_ru(unsigned int i); -__device__ __half __uint2half_rz(unsigned int i); -__device__ __half __ull2half_rd(unsigned long long int i); -__device__ __half __ull2half_rn(unsigned long long int i); -__device__ __half __ull2half_ru(unsigned long long int i); -__device__ __half __ull2half_rz(unsigned long long int i); -__device__ __half __ushort2half_rd(unsigned short int i); -__device__ __half __ushort2half_rn(unsigned short int i); -__device__ __half __ushort2half_ru(unsigned short int i); -__device__ __half __ushort2half_rz(unsigned short int i); -__device__ __half __ushort_as_half(const unsigned short int i); +__device__ __half __short2half_rd(short int i); +__device__ __half __short2half_rn(short int i); +__device__ __half __short2half_ru(short int i); +__device__ __half __short2half_rz(short int i); +__device__ __half __uint2half_rd(unsigned int i); +__device__ __half __uint2half_rn(unsigned int i); +__device__ __half __uint2half_ru(unsigned int i); +__device__ __half __uint2half_rz(unsigned int i); +__device__ __half __ull2half_rd(unsigned long long int i); +__device__ __half __ull2half_rn(unsigned long long int i); +__device__ __half __ull2half_ru(unsigned long long int i); +__device__ __half __ull2half_rz(unsigned long long int i); +__device__ __half __ushort2half_rd(unsigned short int i); +__device__ __half __ushort2half_rn(unsigned short int i); +__device__ __half __ushort2half_ru(unsigned short int i); +__device__ __half __ushort2half_rz(unsigned short int i); +__device__ __half __ushort_as_half(const unsigned short int i); extern "C" __half2 __hip_hc_ir_hadd2_int(__half2, __half2); extern "C" __half2 __hip_hc_ir_hfma2_int(__half2, __half2, __half2); @@ -238,222 +238,202 @@ extern "C" __half2 __hip_hc_ir_h2trunc_int(__half2); */ __device__ static inline __half2 __hadd2(__half2 a, __half2 b) { - __half2 c; - c.xy = __hip_hc_ir_hadd2_int(a.xy, b.xy); - return c; + __half2 c; + c.xy = __hip_hc_ir_hadd2_int(a.xy, b.xy); + return c; } __device__ static inline __half2 __hadd2_sat(__half2 a, __half2 b) { - __half2 c; - c.xy = __hip_hc_ir_hadd2_int(a.xy, b.xy); - return c; + __half2 c; + c.xy = __hip_hc_ir_hadd2_int(a.xy, b.xy); + return c; } __device__ static inline __half2 __hfma2(__half2 a, __half2 b, __half2 c) { - __half2 d; - d.xy = __hip_hc_ir_hfma2_int(a.xy, b.xy, c.xy); - return d; + __half2 d; + d.xy = __hip_hc_ir_hfma2_int(a.xy, b.xy, c.xy); + return d; } __device__ static inline __half2 __hfma2_sat(__half2 a, __half2 b, __half2 c) { - __half2 d; - d.xy = __hip_hc_ir_hfma2_int(a.xy, b.xy, c.xy); - return d; + __half2 d; + d.xy = __hip_hc_ir_hfma2_int(a.xy, b.xy, c.xy); + return d; } __device__ static inline __half2 __hmul2(__half2 a, __half2 b) { - __half2 c; - c.xy = __hip_hc_ir_hmul2_int(a.xy, b.xy); - return c; + __half2 c; + c.xy = __hip_hc_ir_hmul2_int(a.xy, b.xy); + return c; } __device__ static inline __half2 __hmul2_sat(__half2 a, __half2 b) { - __half2 c; - c.xy = __hip_hc_ir_hmul2_int(a.xy, b.xy); - return c; + __half2 c; + c.xy = __hip_hc_ir_hmul2_int(a.xy, b.xy); + return c; } __device__ static inline __half2 __hsub2(__half2 a, __half2 b) { - __half2 c; - c.xy = __hip_hc_ir_hsub2_int(a.xy, b.xy); - return c; + __half2 c; + c.xy = __hip_hc_ir_hsub2_int(a.xy, b.xy); + return c; } __device__ static inline __half2 __hneg2(__half2 a) { - __half2 c; - c.x = - a.x; - c.y = - a.y; - return c; + __half2 c; + c.x = -a.x; + c.y = -a.y; + return c; } __device__ static inline __half2 __hsub2_sat(__half2 a, __half2 b) { - __half2 c; - c.xy = __hip_hc_ir_hsub2_int(a.xy, b.xy); - return c; + __half2 c; + c.xy = __hip_hc_ir_hsub2_int(a.xy, b.xy); + return c; } __device__ static inline __half2 h2div(__half2 a, __half2 b) { - __half2 c; - c.x = a.x / b.x; - c.y = a.y / b.y; - return c; + __half2 c; + c.x = a.x / b.x; + c.y = a.y / b.y; + return c; } -__device__ static inline __half hceil(const __half h) { - return __hip_hc_ir_hceil_half(h); -} +__device__ static inline __half hceil(const __half h) { return __hip_hc_ir_hceil_half(h); } -__device__ static inline __half hcos(const __half h) { - return __hip_hc_ir_hcos_half(h); -} +__device__ static inline __half hcos(const __half h) { return __hip_hc_ir_hcos_half(h); } __device__ static inline __half hexp(const __half h) { - return __hip_hc_ir_hexp2_half(__hmul(h, 1.442694)); + return __hip_hc_ir_hexp2_half(__hmul(h, 1.442694)); } __device__ static inline __half hexp10(const __half h) { - return __hip_hc_ir_hexp2_half(__hmul(h, 3.3219281)); + return __hip_hc_ir_hexp2_half(__hmul(h, 3.3219281)); } -__device__ static inline __half hexp2(const __half h) { - return __hip_hc_ir_hexp2_half(h); -} +__device__ static inline __half hexp2(const __half h) { return __hip_hc_ir_hexp2_half(h); } -__device__ static inline __half hfloor(const __half h) { - return __hip_hc_ir_hfloor_half(h); -} +__device__ static inline __half hfloor(const __half h) { return __hip_hc_ir_hfloor_half(h); } __device__ static inline __half hlog(const __half h) { - return __hmul(__hip_hc_ir_hlog2_half(h), 0.693147); + return __hmul(__hip_hc_ir_hlog2_half(h), 0.693147); } __device__ static inline __half hlog10(const __half h) { - return __hmul(__hip_hc_ir_hlog2_half(h), 0.301029); + return __hmul(__hip_hc_ir_hlog2_half(h), 0.301029); } -__device__ static inline __half hlog2(const __half h) { - return __hip_hc_ir_hlog2_half(h); -} +__device__ static inline __half hlog2(const __half h) { return __hip_hc_ir_hlog2_half(h); } /* __device__ static inline __half hrcp(const __half h) { return __hip_hc_ir_hrcp_half(h); } */ -__device__ static inline __half hrint(const __half h) { - return __hip_hc_ir_hrint_half(h); -} +__device__ static inline __half hrint(const __half h) { return __hip_hc_ir_hrint_half(h); } -__device__ static inline __half hrsqrt(const __half h) { - return __hip_hc_ir_hrsqrt_half(h); -} +__device__ static inline __half hrsqrt(const __half h) { return __hip_hc_ir_hrsqrt_half(h); } -__device__ static inline __half hsin(const __half h) { - return __hip_hc_ir_hsin_half(h); -} +__device__ static inline __half hsin(const __half h) { return __hip_hc_ir_hsin_half(h); } -__device__ static inline __half hsqrt(const __half a) { - return __hip_hc_ir_hsqrt_half(a); -} +__device__ static inline __half hsqrt(const __half a) { return __hip_hc_ir_hsqrt_half(a); } -__device__ static inline __half htrunc(const __half a) { - return __hip_hc_ir_htrunc_half(a); -} +__device__ static inline __half htrunc(const __half a) { return __hip_hc_ir_htrunc_half(a); } /* Half2 Math Operations */ __device__ static inline __half2 h2ceil(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2ceil_int(h.xy); - return a; + __half2 a; + a.xy = __hip_hc_ir_h2ceil_int(h.xy); + return a; } __device__ static inline __half2 h2cos(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2cos_int(h.xy); - return a; + __half2 a; + a.xy = __hip_hc_ir_h2cos_int(h.xy); + return a; } __device__ static inline __half2 h2exp(const __half2 h) { - __half2 factor; - factor.x = 1.442694; - factor.y = 1.442694; - factor.xy = __hip_hc_ir_h2exp2_int(__hip_hc_ir_hmul2_int(h.xy, factor.xy)); - return factor; + __half2 factor; + factor.x = 1.442694; + factor.y = 1.442694; + factor.xy = __hip_hc_ir_h2exp2_int(__hip_hc_ir_hmul2_int(h.xy, factor.xy)); + return factor; } __device__ static inline __half2 h2exp10(const __half2 h) { - __half2 factor; - factor.x = 3.3219281; - factor.y = 3.3219281; - factor.xy = __hip_hc_ir_h2exp2_int(__hip_hc_ir_hmul2_int(h.xy, factor.xy)); - return factor; + __half2 factor; + factor.x = 3.3219281; + factor.y = 3.3219281; + factor.xy = __hip_hc_ir_h2exp2_int(__hip_hc_ir_hmul2_int(h.xy, factor.xy)); + return factor; } __device__ static inline __half2 h2exp2(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2exp2_int(h.xy); - return a; + __half2 a; + a.xy = __hip_hc_ir_h2exp2_int(h.xy); + return a; } __device__ static inline __half2 h2floor(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2floor_int(h.xy); - return a; + __half2 a; + a.xy = __hip_hc_ir_h2floor_int(h.xy); + return a; } __device__ static inline __half2 h2log(const __half2 h) { - __half2 factor; - factor.x = 0.693147; - factor.y = 0.693147; - factor.xy = __hip_hc_ir_hmul2_int(__hip_hc_ir_h2log2_int(h.xy), factor.xy); - return factor; + __half2 factor; + factor.x = 0.693147; + factor.y = 0.693147; + factor.xy = __hip_hc_ir_hmul2_int(__hip_hc_ir_h2log2_int(h.xy), factor.xy); + return factor; } __device__ static inline __half2 h2log10(const __half2 h) { - __half2 factor; - factor.x = 0.301029; - factor.y = 0.301029; - factor.xy = __hip_hc_ir_hmul2_int(__hip_hc_ir_h2log2_int(h.xy), factor.xy); - return factor; + __half2 factor; + factor.x = 0.301029; + factor.y = 0.301029; + factor.xy = __hip_hc_ir_hmul2_int(__hip_hc_ir_h2log2_int(h.xy), factor.xy); + return factor; } __device__ static inline __half2 h2log2(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2log2_int(h.xy); - return a; + __half2 a; + a.xy = __hip_hc_ir_h2log2_int(h.xy); + return a; } __device__ static inline __half2 h2rcp(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2rcp_int(h.xy); - return a; + __half2 a; + a.xy = __hip_hc_ir_h2rcp_int(h.xy); + return a; } __device__ static inline __half2 h2rsqrt(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2rsqrt_int(h.xy); - return a; + __half2 a; + a.xy = __hip_hc_ir_h2rsqrt_int(h.xy); + return a; } __device__ static inline __half2 h2sin(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2sin_int(h.xy); - return a; + __half2 a; + a.xy = __hip_hc_ir_h2sin_int(h.xy); + return a; } __device__ static inline __half2 h2sqrt(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2sqrt_int(h.xy); - return a; + __half2 a; + a.xy = __hip_hc_ir_h2sqrt_int(h.xy); + return a; } __device__ static inline __half2 h2trunc(const __half2 h) { - __half2 a; - a.xy = __hip_hc_ir_h2trunc_int(h.xy); - return a; + __half2 a; + a.xy = __hip_hc_ir_h2trunc_int(h.xy); + return a; } -#endif //clang_major > 3 +#endif // clang_major > 3 #endif diff --git a/hipamd/include/hip/hcc_detail/hip_ldg.h b/hipamd/include/hip/hcc_detail/hip_ldg.h index 473e70b4cb..281550cd4c 100644 --- a/hipamd/include/hip/hcc_detail/hip_ldg.h +++ b/hipamd/include/hip/hcc_detail/hip_ldg.h @@ -28,46 +28,46 @@ THE SOFTWARE. #include "hip_vector_types.h" #include "host_defines.h" -__device__ char __ldg(const char* ); -__device__ char2 __ldg(const char2* ); -__device__ char4 __ldg(const char4* ); -__device__ signed char __ldg(const signed char* ); -__device__ unsigned char __ldg(const unsigned char* ); +__device__ char __ldg(const char*); +__device__ char2 __ldg(const char2*); +__device__ char4 __ldg(const char4*); +__device__ signed char __ldg(const signed char*); +__device__ unsigned char __ldg(const unsigned char*); -__device__ short __ldg(const short* ); -__device__ short2 __ldg(const short2* ); -__device__ short4 __ldg(const short4* ); -__device__ unsigned short __ldg(const unsigned short* ); +__device__ short __ldg(const short*); +__device__ short2 __ldg(const short2*); +__device__ short4 __ldg(const short4*); +__device__ unsigned short __ldg(const unsigned short*); -__device__ int __ldg(const int* ); -__device__ int2 __ldg(const int2* ); -__device__ int4 __ldg(const int4* ); -__device__ unsigned int __ldg(const unsigned int* ); +__device__ int __ldg(const int*); +__device__ int2 __ldg(const int2*); +__device__ int4 __ldg(const int4*); +__device__ unsigned int __ldg(const unsigned int*); -__device__ long __ldg(const long* ); -__device__ unsigned long __ldg(const unsigned long* ); +__device__ long __ldg(const long*); +__device__ unsigned long __ldg(const unsigned long*); -__device__ long long __ldg(const long long* ); -__device__ longlong2 __ldg(const longlong2* ); -__device__ unsigned long long __ldg(const unsigned long long* ); +__device__ long long __ldg(const long long*); +__device__ longlong2 __ldg(const longlong2*); +__device__ unsigned long long __ldg(const unsigned long long*); -__device__ uchar2 __ldg(const uchar2* ); -__device__ uchar4 __ldg(const uchar4* ); +__device__ uchar2 __ldg(const uchar2*); +__device__ uchar4 __ldg(const uchar4*); -__device__ ushort2 __ldg(const ushort2* ); +__device__ ushort2 __ldg(const ushort2*); -__device__ uint2 __ldg(const uint2* ); -__device__ uint4 __ldg(const uint4* ); +__device__ uint2 __ldg(const uint2*); +__device__ uint4 __ldg(const uint4*); -__device__ ulonglong2 __ldg(const ulonglong2* ); +__device__ ulonglong2 __ldg(const ulonglong2*); -__device__ float __ldg(const float* ); -__device__ float2 __ldg(const float2* ); -__device__ float4 __ldg(const float4* ); +__device__ float __ldg(const float*); +__device__ float2 __ldg(const float2*); +__device__ float4 __ldg(const float4*); -__device__ double __ldg(const double* ); -__device__ double2 __ldg(const double2* ); +__device__ double __ldg(const double*); +__device__ double2 __ldg(const double2*); #endif // __hcc_workweek__ diff --git a/hipamd/include/hip/hcc_detail/hip_runtime.h b/hipamd/include/hip/hcc_detail/hip_runtime.h index 0149b68909..90c77c21bc 100644 --- a/hipamd/include/hip/hcc_detail/hip_runtime.h +++ b/hipamd/include/hip/hcc_detail/hip_runtime.h @@ -39,7 +39,7 @@ THE SOFTWARE. #include #include #include -#endif//__cplusplus +#endif //__cplusplus #if __HCC__ @@ -52,7 +52,7 @@ THE SOFTWARE. // define HIP_ENABLE_PRINTF to enable printf #ifdef HIP_ENABLE_PRINTF - #define HCC_ENABLE_ACCELERATOR_PRINTF 1 +#define HCC_ENABLE_ACCELERATOR_PRINTF 1 #endif //--- @@ -60,29 +60,28 @@ THE SOFTWARE. #if defined __HCC__ #include #include "hc_printf.hpp" -//TODO-HCC-GL - change this to typedef. -//typedef grid_launch_parm hipLaunchParm ; +// TODO-HCC-GL - change this to typedef. +// typedef grid_launch_parm hipLaunchParm ; #if GENERIC_GRID_LAUNCH == 0 - #define hipLaunchParm grid_launch_parm +#define hipLaunchParm grid_launch_parm #else -namespace hip_impl -{ - struct Empty_launch_parm {}; -} +namespace hip_impl { +struct Empty_launch_parm {}; +} // namespace hip_impl #define hipLaunchParm hip_impl::Empty_launch_parm -#endif //GENERIC_GRID_LAUNCH +#endif // GENERIC_GRID_LAUNCH -#if defined (GRID_LAUNCH_VERSION) and (GRID_LAUNCH_VERSION >= 20) || GENERIC_GRID_LAUNCH == 1 -#else // Use field names for grid_launch 2.0 structure, if HCC supports GL 2.0. -#error (HCC must support GRID_LAUNCH_20) -#endif //GRID_LAUNCH_VERSION +#if defined(GRID_LAUNCH_VERSION) and (GRID_LAUNCH_VERSION >= 20) || GENERIC_GRID_LAUNCH == 1 +#else // Use field names for grid_launch 2.0 structure, if HCC supports GL 2.0. +#error(HCC must support GRID_LAUNCH_20) +#endif // GRID_LAUNCH_VERSION -#endif //HCC +#endif // HCC -#if GENERIC_GRID_LAUNCH==1 && defined __HCC__ +#if GENERIC_GRID_LAUNCH == 1 && defined __HCC__ #include "grid_launch_GGL.hpp" -#endif//GENERIC_GRID_LAUNCH +#endif // GENERIC_GRID_LAUNCH extern int HIP_TRACE_API; @@ -96,66 +95,67 @@ extern int HIP_TRACE_API; #include // TODO-HCC remove old definitions ; ~1602 hcc supports __HCC_ACCELERATOR__ define. -#if defined (__KALMAR_ACCELERATOR__) && !defined (__HCC_ACCELERATOR__) -#define __HCC_ACCELERATOR__ __KALMAR_ACCELERATOR__ +#if defined(__KALMAR_ACCELERATOR__) && !defined(__HCC_ACCELERATOR__) +#define __HCC_ACCELERATOR__ __KALMAR_ACCELERATOR__ #endif - - // TODO-HCC add a dummy implementation of assert, need to replace with a proper kernel exit call. #if __HIP_DEVICE_COMPILE__ == 1 - #undef assert - #define assert(COND) { if (!(COND)) {abort();} } +#undef assert +#define assert(COND) \ + { \ + if (!(COND)) { \ + abort(); \ + } \ + } #endif - // Feature tests: #if defined(__HCC_ACCELERATOR__) && (__HCC_ACCELERATOR__ != 0) // Device compile and not host compile: - // 32-bit Atomics: -#define __HIP_ARCH_HAS_GLOBAL_INT32_ATOMICS__ (1) -#define __HIP_ARCH_HAS_GLOBAL_FLOAT_ATOMIC_EXCH__ (1) -#define __HIP_ARCH_HAS_SHARED_INT32_ATOMICS__ (1) -#define __HIP_ARCH_HAS_SHARED_FLOAT_ATOMIC_EXCH__ (1) -#define __HIP_ARCH_HAS_FLOAT_ATOMIC_ADD__ (1) +// 32-bit Atomics: +#define __HIP_ARCH_HAS_GLOBAL_INT32_ATOMICS__ (1) +#define __HIP_ARCH_HAS_GLOBAL_FLOAT_ATOMIC_EXCH__ (1) +#define __HIP_ARCH_HAS_SHARED_INT32_ATOMICS__ (1) +#define __HIP_ARCH_HAS_SHARED_FLOAT_ATOMIC_EXCH__ (1) +#define __HIP_ARCH_HAS_FLOAT_ATOMIC_ADD__ (1) // 64-bit Atomics: -#define __HIP_ARCH_HAS_GLOBAL_INT64_ATOMICS__ (1) -#define __HIP_ARCH_HAS_SHARED_INT64_ATOMICS__ (0) +#define __HIP_ARCH_HAS_GLOBAL_INT64_ATOMICS__ (1) +#define __HIP_ARCH_HAS_SHARED_INT64_ATOMICS__ (0) // Doubles -#define __HIP_ARCH_HAS_DOUBLES__ (1) +#define __HIP_ARCH_HAS_DOUBLES__ (1) -//warp cross-lane operations: -#define __HIP_ARCH_HAS_WARP_VOTE__ (1) -#define __HIP_ARCH_HAS_WARP_BALLOT__ (1) -#define __HIP_ARCH_HAS_WARP_SHUFFLE__ (1) -#define __HIP_ARCH_HAS_WARP_FUNNEL_SHIFT__ (0) +// warp cross-lane operations: +#define __HIP_ARCH_HAS_WARP_VOTE__ (1) +#define __HIP_ARCH_HAS_WARP_BALLOT__ (1) +#define __HIP_ARCH_HAS_WARP_SHUFFLE__ (1) +#define __HIP_ARCH_HAS_WARP_FUNNEL_SHIFT__ (0) -//sync -#define __HIP_ARCH_HAS_THREAD_FENCE_SYSTEM__ (1) -#define __HIP_ARCH_HAS_SYNC_THREAD_EXT__ (0) +// sync +#define __HIP_ARCH_HAS_THREAD_FENCE_SYSTEM__ (1) +#define __HIP_ARCH_HAS_SYNC_THREAD_EXT__ (0) // misc -#define __HIP_ARCH_HAS_SURFACE_FUNCS__ (0) -#define __HIP_ARCH_HAS_3DGRID__ (1) -#define __HIP_ARCH_HAS_DYNAMIC_PARALLEL__ (0) +#define __HIP_ARCH_HAS_SURFACE_FUNCS__ (0) +#define __HIP_ARCH_HAS_3DGRID__ (1) +#define __HIP_ARCH_HAS_DYNAMIC_PARALLEL__ (0) #endif /* Device feature flags */ -#define launch_bounds_impl0(requiredMaxThreadsPerBlock)\ +#define launch_bounds_impl0(requiredMaxThreadsPerBlock) \ __attribute__((amdgpu_flat_work_group_size(1, requiredMaxThreadsPerBlock))) -#define launch_bounds_impl1(\ - requiredMaxThreadsPerBlock, minBlocksPerMultiprocessor)\ - __attribute__((amdgpu_flat_work_group_size(1, requiredMaxThreadsPerBlock),\ - amdgpu_waves_per_eu(minBlocksPerMultiprocessor))) +#define launch_bounds_impl1(requiredMaxThreadsPerBlock, minBlocksPerMultiprocessor) \ + __attribute__((amdgpu_flat_work_group_size(1, requiredMaxThreadsPerBlock), \ + amdgpu_waves_per_eu(minBlocksPerMultiprocessor))) #define select_impl_(_1, _2, impl_, ...) impl_ -#define __launch_bounds__(...) select_impl_(\ - __VA_ARGS__, launch_bounds_impl1, launch_bounds_impl0)(__VA_ARGS__) +#define __launch_bounds__(...) \ + select_impl_(__VA_ARGS__, launch_bounds_impl1, launch_bounds_impl0)(__VA_ARGS__) // Detect if we are compiling C++ mode or C mode #if defined(__cplusplus) @@ -172,114 +172,102 @@ static constexpr int warpSize = 64; __device__ long long int clock64(); __device__ clock_t clock(); -//abort +// abort __device__ void abort(); -//atomicAdd() +// atomicAdd() __device__ int atomicAdd(int* address, int val); -__device__ unsigned int atomicAdd(unsigned int* address, - unsigned int val); +__device__ unsigned int atomicAdd(unsigned int* address, unsigned int val); __device__ unsigned long long int atomicAdd(unsigned long long int* address, - unsigned long long int val); + unsigned long long int val); __device__ float atomicAdd(float* address, float val); -//atomicSub() +// atomicSub() __device__ int atomicSub(int* address, int val); -__device__ unsigned int atomicSub(unsigned int* address, - unsigned int val); +__device__ unsigned int atomicSub(unsigned int* address, unsigned int val); -//atomicExch() +// atomicExch() __device__ int atomicExch(int* address, int val); -__device__ unsigned int atomicExch(unsigned int* address, - unsigned int val); +__device__ unsigned int atomicExch(unsigned int* address, unsigned int val); __device__ unsigned long long int atomicExch(unsigned long long int* address, - unsigned long long int val); + unsigned long long int val); __device__ float atomicExch(float* address, float val); -//atomicMin() +// atomicMin() __device__ int atomicMin(int* address, int val); -__device__ unsigned int atomicMin(unsigned int* address, - unsigned int val); +__device__ unsigned int atomicMin(unsigned int* address, unsigned int val); __device__ unsigned long long int atomicMin(unsigned long long int* address, - unsigned long long int val); + unsigned long long int val); -//atomicMax() +// atomicMax() __device__ int atomicMax(int* address, int val); -__device__ unsigned int atomicMax(unsigned int* address, - unsigned int val); +__device__ unsigned int atomicMax(unsigned int* address, unsigned int val); __device__ unsigned long long int atomicMax(unsigned long long int* address, - unsigned long long int val); + unsigned long long int val); -//atomicCAS() +// atomicCAS() __device__ int atomicCAS(int* address, int compare, int val); -__device__ unsigned int atomicCAS(unsigned int* address, - unsigned int compare, - unsigned int val); +__device__ unsigned int atomicCAS(unsigned int* address, unsigned int compare, unsigned int val); __device__ unsigned long long int atomicCAS(unsigned long long int* address, - unsigned long long int compare, - unsigned long long int val); + unsigned long long int compare, + unsigned long long int val); -//atomicAnd() +// atomicAnd() __device__ int atomicAnd(int* address, int val); -__device__ unsigned int atomicAnd(unsigned int* address, - unsigned int val); +__device__ unsigned int atomicAnd(unsigned int* address, unsigned int val); __device__ unsigned long long int atomicAnd(unsigned long long int* address, - unsigned long long int val); + unsigned long long int val); -//atomicOr() +// atomicOr() __device__ int atomicOr(int* address, int val); -__device__ unsigned int atomicOr(unsigned int* address, - unsigned int val); +__device__ unsigned int atomicOr(unsigned int* address, unsigned int val); __device__ unsigned long long int atomicOr(unsigned long long int* address, - unsigned long long int val); + unsigned long long int val); -//atomicXor() +// atomicXor() __device__ int atomicXor(int* address, int val); -__device__ unsigned int atomicXor(unsigned int* address, - unsigned int val); +__device__ unsigned int atomicXor(unsigned int* address, unsigned int val); __device__ unsigned long long int atomicXor(unsigned long long int* address, - unsigned long long int val); + unsigned long long int val); -//atomicInc() -__device__ unsigned int atomicInc(unsigned int* address, - unsigned int val); +// atomicInc() +__device__ unsigned int atomicInc(unsigned int* address, unsigned int val); -//atomicDec() -__device__ unsigned int atomicDec(unsigned int* address, - unsigned int val); +// atomicDec() +__device__ unsigned int atomicDec(unsigned int* address, unsigned int val); - // warp vote function __all __any __ballot -__device__ int __all( int input); -__device__ int __any( int input); -__device__ unsigned long long int __ballot( int input); +// warp vote function __all __any __ballot +__device__ int __all(int input); +__device__ int __any(int input); +__device__ unsigned long long int __ballot(int input); #if __HIP_ARCH_GFX701__ == 0 // warp shuffle functions #ifdef __cplusplus -__device__ int __shfl(int input, int lane, int width=warpSize); -__device__ int __shfl_up(int input, unsigned int lane_delta, int width=warpSize); -__device__ int __shfl_down(int input, unsigned int lane_delta, int width=warpSize); -__device__ int __shfl_xor(int input, int lane_mask, int width=warpSize); -__device__ float __shfl(float input, int lane, int width=warpSize); -__device__ float __shfl_up(float input, unsigned int lane_delta, int width=warpSize); -__device__ float __shfl_down(float input, unsigned int lane_delta, int width=warpSize); -__device__ float __shfl_xor(float input, int lane_mask, int width=warpSize); +__device__ int __shfl(int input, int lane, int width = warpSize); +__device__ int __shfl_up(int input, unsigned int lane_delta, int width = warpSize); +__device__ int __shfl_down(int input, unsigned int lane_delta, int width = warpSize); +__device__ int __shfl_xor(int input, int lane_mask, int width = warpSize); +__device__ float __shfl(float input, int lane, int width = warpSize); +__device__ float __shfl_up(float input, unsigned int lane_delta, int width = warpSize); +__device__ float __shfl_down(float input, unsigned int lane_delta, int width = warpSize); +__device__ float __shfl_xor(float input, int lane_mask, int width = warpSize); #else __device__ int __shfl(int input, int lane, int width); __device__ int __shfl_up(int input, unsigned int lane_delta, int width); @@ -289,7 +277,7 @@ __device__ float __shfl(float input, int lane, int width); __device__ float __shfl_up(float input, unsigned int lane_delta, int width); __device__ float __shfl_down(float input, unsigned int lane_delta, int width); __device__ float __shfl_xor(float input, int lane_mask, int width); -#endif //__cplusplus +#endif //__cplusplus __device__ unsigned __hip_ds_bpermute(int index, unsigned src); __device__ float __hip_ds_bpermutef(int index, float src); @@ -301,7 +289,7 @@ __device__ float __hip_ds_swizzlef(float src, int pattern); __device__ int __hip_move_dpp(int src, int dpp_ctrl, int row_mask, int bank_mask, bool bound_ctrl); -#endif //__HIP_ARCH_GFX803__ == 1 +#endif //__HIP_ARCH_GFX803__ == 1 __host__ __device__ int min(int arg1, int arg2); __host__ __device__ int max(int arg1, int arg2); @@ -327,17 +315,19 @@ __device__ void* __get_dynamicgroupbaseptr(); * * * @warning The HIP memory fence functions are currently not supported yet. - * If any of those threadfence stubs are reached by the application, you should set "export HSA_DISABLE_CACHE=1" to disable L1 and L2 caches. + * If any of those threadfence stubs are reached by the application, you should set "export + *HSA_DISABLE_CACHE=1" to disable L1 and L2 caches. * * * On AMD platforms, the threadfence* routines are currently empty stubs. */ extern __attribute__((const)) __device__ void __hip_hc_threadfence() __asm("__llvm_fence_sc_dev"); -extern __attribute__((const)) __device__ void __hip_hc_threadfence_block() __asm("__llvm_fence_sc_wg"); +extern __attribute__((const)) __device__ void __hip_hc_threadfence_block() __asm( + "__llvm_fence_sc_wg"); - /** +/** * @brief threadfence_block makes writes visible to threads running in same block. * * @Returns void @@ -347,23 +337,21 @@ extern __attribute__((const)) __device__ void __hip_hc_threadfence_block() __asm * @warning __threadfence_block is a stub and map to no-op. */ // __device__ void __threadfence_block(void); -__device__ static inline void __threadfence_block(void) { - return __hip_hc_threadfence_block(); -} +__device__ static inline void __threadfence_block(void) { return __hip_hc_threadfence_block(); } - /** - * @brief threadfence makes wirtes visible to other threads running on same GPU. +/** + * @brief threadfence makes wirtes visible to other threads running on same GPU. * * @Returns void * * @param void * - * @warning __threadfence is a stub and map to no-op, application should set "export HSA_DISABLE_CACHE=1" to disable both L1 and L2 caches. + * @warning __threadfence is a stub and map to no-op, application should set "export + * HSA_DISABLE_CACHE=1" to disable both L1 and L2 caches. */ -// __device__ void __threadfence(void) __attribute__((deprecated("Provided for compile-time compatibility, not yet functional"))); -__device__ static inline void __threadfence(void) { - return __hip_hc_threadfence(); -} +// __device__ void __threadfence(void) __attribute__((deprecated("Provided for compile-time +// compatibility, not yet functional"))); +__device__ static inline void __threadfence(void) { return __hip_hc_threadfence(); } /** * @brief threadfence_system makes writes to pinned system memory visible on host CPU. @@ -374,26 +362,32 @@ __device__ static inline void __threadfence(void) { * * @warning __threadfence_system is a stub and map to no-op. */ -//__device__ void __threadfence_system(void) __attribute__((deprecated("Provided with workaround configuration, see hip_kernel_language.md for details"))); -__device__ void __threadfence_system(void) ; +//__device__ void __threadfence_system(void) __attribute__((deprecated("Provided with workaround +//configuration, see hip_kernel_language.md for details"))); +__device__ void __threadfence_system(void); // doxygen end Fence Fence /** * @} */ -template::type f> +template < + typename std::common_type::type f> class Coordinates { using R = decltype(f(0)); - struct X { __device__ operator R() const { return f(0); } }; - struct Y { __device__ operator R() const { return f(1); } }; - struct Z { __device__ operator R() const { return f(2); } }; -public: + struct X { + __device__ operator R() const { return f(0); } + }; + struct Y { + __device__ operator R() const { return f(1); } + }; + struct Z { + __device__ operator R() const { return f(2); } + }; + + public: static constexpr X x{}; static constexpr Y y{}; static constexpr Z z{}; @@ -408,42 +402,34 @@ static constexpr Coordinates threadIdx; #define hipThreadIdx_y (hc_get_workitem_id(1)) #define hipThreadIdx_z (hc_get_workitem_id(2)) -#define hipBlockIdx_x (hc_get_group_id(0)) -#define hipBlockIdx_y (hc_get_group_id(1)) -#define hipBlockIdx_z (hc_get_group_id(2)) +#define hipBlockIdx_x (hc_get_group_id(0)) +#define hipBlockIdx_y (hc_get_group_id(1)) +#define hipBlockIdx_z (hc_get_group_id(2)) -#define hipBlockDim_x (hc_get_group_size(0)) -#define hipBlockDim_y (hc_get_group_size(1)) -#define hipBlockDim_z (hc_get_group_size(2)) +#define hipBlockDim_x (hc_get_group_size(0)) +#define hipBlockDim_y (hc_get_group_size(1)) +#define hipBlockDim_z (hc_get_group_size(2)) -#define hipGridDim_x (hc_get_num_groups(0)) -#define hipGridDim_y (hc_get_num_groups(1)) -#define hipGridDim_z (hc_get_num_groups(2)) +#define hipGridDim_x (hc_get_num_groups(0)) +#define hipGridDim_y (hc_get_num_groups(1)) +#define hipGridDim_z (hc_get_num_groups(2)) extern "C" __device__ void* __hip_hc_memcpy(void* dst, const void* src, size_t size); extern "C" __device__ void* __hip_hc_memset(void* ptr, uint8_t val, size_t size); extern "C" __device__ void* __hip_hc_malloc(size_t); -extern "C" __device__ void* __hip_hc_free(void *ptr); +extern "C" __device__ void* __hip_hc_free(void* ptr); -static inline __device__ void* malloc(size_t size) -{ - return __hip_hc_malloc(size); +static inline __device__ void* malloc(size_t size) { return __hip_hc_malloc(size); } + +static inline __device__ void* free(void* ptr) { return __hip_hc_free(ptr); } + +static inline __device__ void* memcpy(void* dst, const void* src, size_t size) { + return __hip_hc_memcpy(dst, src, size); } -static inline __device__ void* free(void *ptr) -{ - return __hip_hc_free(ptr); -} - -static inline __device__ void* memcpy(void* dst, const void* src, size_t size) -{ - return __hip_hc_memcpy(dst, src, size); -} - -static inline __device__ void* memset(void* ptr, int val, size_t size) -{ - uint8_t val8 = static_cast (val); - return __hip_hc_memset(ptr, val8, size); +static inline __device__ void* memset(void* ptr, int val, size_t size) { + uint8_t val8 = static_cast(val); + return __hip_hc_memset(ptr, val8, size); } @@ -452,11 +438,11 @@ static inline __device__ void* memset(void* ptr, int val, size_t size) #ifdef HC_FEATURE_PRINTF template static inline __device__ void printf(const char* format, All... all) { - hc::printf(format, all...); + hc::printf(format, all...); } #else template -static inline __device__ void printf(const char* format, All... all) { } +static inline __device__ void printf(const char* format, All... all) {} #endif #endif @@ -464,34 +450,40 @@ static inline __device__ void printf(const char* format, All... all) { } #define __syncthreads() hc_barrier(CLK_LOCAL_MEM_FENCE) -#define HIP_KERNEL_NAME(...) (__VA_ARGS__) +#define HIP_KERNEL_NAME(...) (__VA_ARGS__) #define HIP_SYMBOL(X) #X #if defined __HCC_CPP__ -extern hipStream_t ihipPreLaunchKernel(hipStream_t stream, dim3 grid, dim3 block, grid_launch_parm *lp, const char *kernelNameStr); -extern hipStream_t ihipPreLaunchKernel(hipStream_t stream, dim3 grid, size_t block, grid_launch_parm *lp, const char *kernelNameStr); -extern hipStream_t ihipPreLaunchKernel(hipStream_t stream, size_t grid, dim3 block, grid_launch_parm *lp, const char *kernelNameStr); -extern hipStream_t ihipPreLaunchKernel(hipStream_t stream, size_t grid, size_t block, grid_launch_parm *lp, const char *kernelNameStr); -extern void ihipPostLaunchKernel(const char *kernelName, hipStream_t stream, grid_launch_parm &lp); +extern hipStream_t ihipPreLaunchKernel(hipStream_t stream, dim3 grid, dim3 block, + grid_launch_parm* lp, const char* kernelNameStr); +extern hipStream_t ihipPreLaunchKernel(hipStream_t stream, dim3 grid, size_t block, + grid_launch_parm* lp, const char* kernelNameStr); +extern hipStream_t ihipPreLaunchKernel(hipStream_t stream, size_t grid, dim3 block, + grid_launch_parm* lp, const char* kernelNameStr); +extern hipStream_t ihipPreLaunchKernel(hipStream_t stream, size_t grid, size_t block, + grid_launch_parm* lp, const char* kernelNameStr); +extern void ihipPostLaunchKernel(const char* kernelName, hipStream_t stream, grid_launch_parm& lp); #if GENERIC_GRID_LAUNCH == 0 //#warning "Original hipLaunchKernel defined" -// Due to multiple overloaded versions of ihipPreLaunchKernel, the numBlocks3D and blockDim3D can be either size_t or dim3 types -#define hipLaunchKernel(_kernelName, _numBlocks3D, _blockDim3D, _groupMemBytes, _stream, ...) \ -do {\ - grid_launch_parm lp;\ - lp.dynamic_group_mem_bytes = _groupMemBytes; \ - hipStream_t trueStream = (ihipPreLaunchKernel(_stream, _numBlocks3D, _blockDim3D, &lp, #_kernelName)); \ - _kernelName (lp, ##__VA_ARGS__);\ - ihipPostLaunchKernel(#_kernelName, trueStream, lp);\ -} while(0) -#endif //GENERIC_GRID_LAUNCH +// Due to multiple overloaded versions of ihipPreLaunchKernel, the numBlocks3D and blockDim3D can be +// either size_t or dim3 types +#define hipLaunchKernel(_kernelName, _numBlocks3D, _blockDim3D, _groupMemBytes, _stream, ...) \ + do { \ + grid_launch_parm lp; \ + lp.dynamic_group_mem_bytes = _groupMemBytes; \ + hipStream_t trueStream = \ + (ihipPreLaunchKernel(_stream, _numBlocks3D, _blockDim3D, &lp, #_kernelName)); \ + _kernelName(lp, ##__VA_ARGS__); \ + ihipPostLaunchKernel(#_kernelName, trueStream, lp); \ + } while (0) +#endif // GENERIC_GRID_LAUNCH -#elif defined (__HCC_C__) +#elif defined(__HCC_C__) -//TODO - develop C interface. +// TODO - develop C interface. -#endif //__HCC_CPP__ +#endif //__HCC_CPP__ /** * extern __shared__ @@ -499,21 +491,18 @@ do {\ // Macro to replace extern __shared__ declarations // to local variable definitions -#define HIP_DYNAMIC_SHARED(type, var) \ - type* var = \ - (type*)__get_dynamicgroupbaseptr(); \ +#define HIP_DYNAMIC_SHARED(type, var) type* var = (type*)__get_dynamicgroupbaseptr(); #define HIP_DYNAMIC_SHARED_ATTRIBUTE - /** * @defgroup HIP-ENV HIP Environment Variables * @{ */ -//extern int HIP_PRINT_ENV ; ///< Print all HIP-related environment variables. -//extern int HIP_TRACE_API; ///< Trace HIP APIs. -//extern int HIP_LAUNCH_BLOCKING ; ///< Make all HIP APIs host-synchronous +// extern int HIP_PRINT_ENV ; ///< Print all HIP-related environment variables. +// extern int HIP_TRACE_API; ///< Trace HIP APIs. +// extern int HIP_LAUNCH_BLOCKING ; ///< Make all HIP APIs host-synchronous /** * @} @@ -532,17 +521,17 @@ do {\ #define hipSetupArgument cudaSetupArgument #define hipLaunch cudaLaunch -typedef int hipLaunchParm ; +typedef int hipLaunchParm; -#define hipLaunchKernel(kernelName, numblocks, numthreads, memperblock, streamId, ...) \ -do {\ - kernelName<<>>(0, ##__VA_ARGS__);\ -} while(0) +#define hipLaunchKernel(kernelName, numblocks, numthreads, memperblock, streamId, ...) \ + do { \ + kernelName<<>>(0, ##__VA_ARGS__); \ + } while (0) -#define hipLaunchKernelGGL(kernelName, numblocks, numthreads, memperblock, streamId, ...) \ -do {\ - kernelName<<>>(__VA_ARGS__);\ -} while(0) +#define hipLaunchKernelGGL(kernelName, numblocks, numthreads, memperblock, streamId, ...) \ + do { \ + kernelName<<>>(__VA_ARGS__); \ + } while (0) #include @@ -551,8 +540,8 @@ extern "C" { #endif /*__cplusplus*/ hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem, hipStream_t stream); -hipError_t hipSetupArgument(const void *arg, size_t size, size_t offset); -hipError_t hipLaunch(const void *func); +hipError_t hipSetupArgument(const void* arg, size_t size, size_t offset); +hipError_t hipLaunch(const void* func); #if defined(__cplusplus) } @@ -564,18 +553,18 @@ hipError_t hipLaunch(const void *func); #define hipThreadIdx_y threadIdx.y #define hipThreadIdx_z threadIdx.z -#define hipBlockIdx_x blockIdx.x -#define hipBlockIdx_y blockIdx.y -#define hipBlockIdx_z blockIdx.z +#define hipBlockIdx_x blockIdx.x +#define hipBlockIdx_y blockIdx.y +#define hipBlockIdx_z blockIdx.z -#define hipBlockDim_x blockDim.x -#define hipBlockDim_y blockDim.y -#define hipBlockDim_z blockDim.z +#define hipBlockDim_x blockDim.x +#define hipBlockDim_y blockDim.y +#define hipBlockDim_z blockDim.z -#define hipGridDim_x gridDim.x -#define hipGridDim_y gridDim.y -#define hipGridDim_z gridDim.z +#define hipGridDim_x gridDim.x +#define hipGridDim_y gridDim.y +#define hipGridDim_z gridDim.z #endif -#endif//HIP_HCC_DETAIL_RUNTIME_H +#endif // HIP_HCC_DETAIL_RUNTIME_H diff --git a/hipamd/include/hip/hcc_detail/hip_runtime_api.h b/hipamd/include/hip/hcc_detail/hip_runtime_api.h index ccfd56f65b..7eea69186e 100644 --- a/hipamd/include/hip/hcc_detail/hip_runtime_api.h +++ b/hipamd/include/hip/hcc_detail/hip_runtime_api.h @@ -25,7 +25,8 @@ THE SOFTWARE. #define HIP_INCLUDE_HIP_HCC_DETAIL_HIP_RUNTIME_API_H /** * @file hcc_detail/hip_runtime_api.h - * @brief Contains C function APIs for HIP runtime. This file does not use any HCC builtin or special language extensions (-hc mode) ; those functions in hip_runtime.h. + * @brief Contains C function APIs for HIP runtime. This file does not use any HCC builtin or + * special language extensions (-hc mode) ; those functions in hip_runtime.h. */ #include #include @@ -41,13 +42,13 @@ THE SOFTWARE. #include #include -#if defined (__HCC__) && (__hcc_workweek__ < 16155) +#if defined(__HCC__) && (__hcc_workweek__ < 16155) #error("This version of HIP requires a newer version of HCC."); #endif -#define HIP_LAUNCH_PARAM_BUFFER_POINTER ((void*) 0x01) -#define HIP_LAUNCH_PARAM_BUFFER_SIZE ((void*) 0x02) -#define HIP_LAUNCH_PARAM_END ((void*) 0x03) +#define HIP_LAUNCH_PARAM_BUFFER_POINTER ((void*)0x01) +#define HIP_LAUNCH_PARAM_BUFFER_SIZE ((void*)0x02) +#define HIP_LAUNCH_PARAM_END ((void*)0x03) // Structure definitions: #ifdef __cplusplus @@ -55,40 +56,38 @@ extern "C" { #endif //--- -//API-visible structures -typedef struct ihipCtx_t *hipCtx_t; +// API-visible structures +typedef struct ihipCtx_t* hipCtx_t; // Note many APIs also use integer deviceIds as an alternative to the device pointer: typedef int hipDevice_t; -typedef struct ihipStream_t *hipStream_t; +typedef struct ihipStream_t* hipStream_t; -//TODO: IPC implementation +// TODO: IPC implementation #define hipIpcMemLazyEnablePeerAccess 0 #define HIP_IPC_HANDLE_SIZE 64 -typedef struct hipIpcMemHandle_st -{ +typedef struct hipIpcMemHandle_st { char reserved[HIP_IPC_HANDLE_SIZE]; -}hipIpcMemHandle_t; +} hipIpcMemHandle_t; -//TODO: IPC event handle currently unsupported +// TODO: IPC event handle currently unsupported struct ihipIpcEventHandle_t; -typedef struct ihipIpcEventHandle_t *hipIpcEventHandle_t; +typedef struct ihipIpcEventHandle_t* hipIpcEventHandle_t; -//END TODO +// END TODO -typedef struct ihipModule_t *hipModule_t; +typedef struct ihipModule_t* hipModule_t; -typedef struct ihipModuleSymbol_t *hipFunction_t; +typedef struct ihipModuleSymbol_t* hipFunction_t; -typedef struct ihipEvent_t *hipEvent_t; +typedef struct ihipEvent_t* hipEvent_t; -enum hipLimit_t -{ +enum hipLimit_t { hipLimitMallocHeapSize = 0x02, }; @@ -97,75 +96,95 @@ enum hipLimit_t * @{ */ //! Flags that can be used with hipStreamCreateWithFlags -#define hipStreamDefault 0x00 ///< Default stream creation flags. These are used with hipStreamCreate(). -#define hipStreamNonBlocking 0x01 ///< Stream does not implicitly synchronize with null stream +#define hipStreamDefault \ + 0x00 ///< Default stream creation flags. These are used with hipStreamCreate(). +#define hipStreamNonBlocking 0x01 ///< Stream does not implicitly synchronize with null stream //! Flags that can be used with hipEventCreateWithFlags: -#define hipEventDefault 0x0 ///< Default flags -#define hipEventBlockingSync 0x1 ///< Waiting will yield CPU. Power-friendly and usage-friendly but may increase latency. -#define hipEventDisableTiming 0x2 ///< Disable event's capability to record timing information. May improve performance. -#define hipEventInterprocess 0x4 ///< Event can support IPC. @warning - not supported in HIP. -#define hipEventReleaseToDevice 0x40000000 /// < Use a device-scope release when recording this event. This flag is useful to obtain more precise timings of commands between events. The flag is a no-op on CUDA platforms. -#define hipEventReleaseToSystem 0x80000000 /// < Use a system-scope release that when recording this event. This flag is useful to make non-coherent host memory visible to the host. The flag is a no-op on CUDA platforms. +#define hipEventDefault 0x0 ///< Default flags +#define hipEventBlockingSync \ + 0x1 ///< Waiting will yield CPU. Power-friendly and usage-friendly but may increase latency. +#define hipEventDisableTiming \ + 0x2 ///< Disable event's capability to record timing information. May improve performance. +#define hipEventInterprocess 0x4 ///< Event can support IPC. @warning - not supported in HIP. +#define hipEventReleaseToDevice \ + 0x40000000 /// < Use a device-scope release when recording this event. This flag is useful to + /// obtain more precise timings of commands between events. The flag is a no-op on + /// CUDA platforms. +#define hipEventReleaseToSystem \ + 0x80000000 /// < Use a system-scope release that when recording this event. This flag is + /// useful to make non-coherent host memory visible to the host. The flag is a + /// no-op on CUDA platforms. //! Flags that can be used with hipHostMalloc -#define hipHostMallocDefault 0x0 -#define hipHostMallocPortable 0x1 ///< Memory is considered allocated by all contexts. -#define hipHostMallocMapped 0x2 ///< Map the allocation into the address space for the current device. The device pointer can be obtained with #hipHostGetDevicePointer. -#define hipHostMallocWriteCombined 0x4 -#define hipHostMallocCoherent 0x40000000 ///< Allocate coherent memory. Overrides HIP_COHERENT_HOST_ALLOC for specific allocation. -#define hipHostMallocNonCoherent 0x80000000 ///< Allocate non-coherent memory. Overrides HIP_COHERENT_HOST_ALLOC for specific allocation. +#define hipHostMallocDefault 0x0 +#define hipHostMallocPortable 0x1 ///< Memory is considered allocated by all contexts. +#define hipHostMallocMapped \ + 0x2 ///< Map the allocation into the address space for the current device. The device pointer + ///< can be obtained with #hipHostGetDevicePointer. +#define hipHostMallocWriteCombined 0x4 +#define hipHostMallocCoherent \ + 0x40000000 ///< Allocate coherent memory. Overrides HIP_COHERENT_HOST_ALLOC for specific + ///< allocation. +#define hipHostMallocNonCoherent \ + 0x80000000 ///< Allocate non-coherent memory. Overrides HIP_COHERENT_HOST_ALLOC for specific + ///< allocation. //! Flags that can be used with hipHostRegister -#define hipHostRegisterDefault 0x0 ///< Memory is Mapped and Portable -#define hipHostRegisterPortable 0x1 ///< Memory is considered registered by all contexts. -#define hipHostRegisterMapped 0x2 ///< Map the allocation into the address space for the current device. The device pointer can be obtained with #hipHostGetDevicePointer. -#define hipHostRegisterIoMemory 0x4 ///< Not supported. +#define hipHostRegisterDefault 0x0 ///< Memory is Mapped and Portable +#define hipHostRegisterPortable 0x1 ///< Memory is considered registered by all contexts. +#define hipHostRegisterMapped \ + 0x2 ///< Map the allocation into the address space for the current device. The device pointer + ///< can be obtained with #hipHostGetDevicePointer. +#define hipHostRegisterIoMemory 0x4 ///< Not supported. - -#define hipDeviceScheduleAuto 0x0 ///< Automatically select between Spin and Yield -#define hipDeviceScheduleSpin 0x1 ///< Dedicate a CPU core to spin-wait. Provides lowest latency, but burns a CPU core and may consume more power. -#define hipDeviceScheduleYield 0x2 ///< Yield the CPU to the operating system when waiting. May increase latency, but lowers power and is friendlier to other threads in the system. +#define hipDeviceScheduleAuto 0x0 ///< Automatically select between Spin and Yield +#define hipDeviceScheduleSpin \ + 0x1 ///< Dedicate a CPU core to spin-wait. Provides lowest latency, but burns a CPU core and + ///< may consume more power. +#define hipDeviceScheduleYield \ + 0x2 ///< Yield the CPU to the operating system when waiting. May increase latency, but lowers + ///< power and is friendlier to other threads in the system. #define hipDeviceScheduleBlockingSync 0x4 -#define hipDeviceScheduleMask 0x7 +#define hipDeviceScheduleMask 0x7 -#define hipDeviceMapHost 0x8 -#define hipDeviceLmemResizeToMax 0x16 +#define hipDeviceMapHost 0x8 +#define hipDeviceLmemResizeToMax 0x16 -#define hipArrayDefault 0x00 ///< Default HIP array allocation flag -#define hipArrayLayered 0x01 -#define hipArraySurfaceLoadStore 0x02 -#define hipArrayCubemap 0x04 -#define hipArrayTextureGather 0x08 +#define hipArrayDefault 0x00 ///< Default HIP array allocation flag +#define hipArrayLayered 0x01 +#define hipArraySurfaceLoadStore 0x02 +#define hipArrayCubemap 0x04 +#define hipArrayTextureGather 0x08 /* -* @brief hipJitOption -* @enum -* @ingroup Enumerations -*/ + * @brief hipJitOption + * @enum + * @ingroup Enumerations + */ typedef enum hipJitOption { - hipJitOptionMaxRegisters = 0, - hipJitOptionThreadsPerBlock, - hipJitOptionWallTime, - hipJitOptionInfoLogBuffer, - hipJitOptionInfoLogBufferSizeBytes, - hipJitOptionErrorLogBuffer, - hipJitOptionErrorLogBufferSizeBytes, - hipJitOptionOptimizationLevel, - hipJitOptionTargetFromContext, - hipJitOptionTarget, - hipJitOptionFallbackStrategy, - hipJitOptionGenerateDebugInfo, - hipJitOptionLogVerbose, - hipJitOptionGenerateLineInfo, - hipJitOptionCacheMode, - hipJitOptionSm3xOpt, - hipJitOptionFastCompile, - hipJitOptionNumOptions + hipJitOptionMaxRegisters = 0, + hipJitOptionThreadsPerBlock, + hipJitOptionWallTime, + hipJitOptionInfoLogBuffer, + hipJitOptionInfoLogBufferSizeBytes, + hipJitOptionErrorLogBuffer, + hipJitOptionErrorLogBufferSizeBytes, + hipJitOptionOptimizationLevel, + hipJitOptionTargetFromContext, + hipJitOptionTarget, + hipJitOptionFallbackStrategy, + hipJitOptionGenerateDebugInfo, + hipJitOptionLogVerbose, + hipJitOptionGenerateLineInfo, + hipJitOptionCacheMode, + hipJitOptionSm3xOpt, + hipJitOptionFastCompile, + hipJitOptionNumOptions } hipJitOption; @@ -173,10 +192,10 @@ typedef enum hipJitOption { * @warning On AMD devices and some Nvidia devices, these hints and controls are ignored. */ typedef enum hipFuncCache_t { - hipFuncCachePreferNone, ///< no preference for shared memory or L1 (default) - hipFuncCachePreferShared, ///< prefer larger shared memory and smaller L1 cache - hipFuncCachePreferL1, ///< prefer larger L1 cache and smaller shared memory - hipFuncCachePreferEqual, ///< prefer equal size L1 cache and shared memory + hipFuncCachePreferNone, ///< no preference for shared memory or L1 (default) + hipFuncCachePreferShared, ///< prefer larger shared memory and smaller L1 cache + hipFuncCachePreferL1, ///< prefer larger L1 cache and smaller shared memory + hipFuncCachePreferEqual, ///< prefer equal size L1 cache and shared memory } hipFuncCache_t; @@ -184,23 +203,24 @@ typedef enum hipFuncCache_t { * @warning On AMD devices and some Nvidia devices, these hints and controls are ignored. */ typedef enum hipSharedMemConfig { - hipSharedMemBankSizeDefault, ///< The compiler selects a device-specific value for the banking. - hipSharedMemBankSizeFourByte, ///< Shared mem is banked at 4-bytes intervals and performs best when adjacent threads access data 4 bytes apart. - hipSharedMemBankSizeEightByte ///< Shared mem is banked at 8-byte intervals and performs best when adjacent threads access data 4 bytes apart. + hipSharedMemBankSizeDefault, ///< The compiler selects a device-specific value for the banking. + hipSharedMemBankSizeFourByte, ///< Shared mem is banked at 4-bytes intervals and performs best + ///< when adjacent threads access data 4 bytes apart. + hipSharedMemBankSizeEightByte ///< Shared mem is banked at 8-byte intervals and performs best + ///< when adjacent threads access data 4 bytes apart. } hipSharedMemConfig; - /** * Struct for data in 3D * */ typedef struct dim3 { - uint32_t x; ///< x - uint32_t y; ///< y - uint32_t z; ///< z + uint32_t x; ///< x + uint32_t y; ///< y + uint32_t z; ///< z #ifdef __cplusplus - dim3(uint32_t _x=1, uint32_t _y=1, uint32_t _z=1) : x(_x), y(_y), z(_z) {}; + dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z){}; #endif } dim3; @@ -212,23 +232,20 @@ typedef struct dim3 { //------------------------------------------------------------------------------------------------- -// The handle allows the async commands to use the stream even if the parent hipStream_t goes out-of-scope. -//typedef class ihipStream_t * hipStream_t; +// The handle allows the async commands to use the stream even if the parent hipStream_t goes +// out-of-scope. +// typedef class ihipStream_t * hipStream_t; /* - * Opaque structure allows the true event (pointed at by the handle) to remain "live" even if the surrounding hipEvent_t goes out-of-scope. - * This is handy for cases where the hipEvent_t goes out-of-scope but the true event is being written by some async queue or device */ -//typedef struct hipEvent_t { + * Opaque structure allows the true event (pointed at by the handle) to remain "live" even if the + * surrounding hipEvent_t goes out-of-scope. This is handy for cases where the hipEvent_t goes + * out-of-scope but the true event is being written by some async queue or device */ +// typedef struct hipEvent_t { // struct ihipEvent_t *_handle; //} hipEvent_t; - - - - - /** * @defgroup API HIP API * @{ @@ -237,7 +254,6 @@ typedef struct dim3 { */ - /** *------------------------------------------------------------------------------------------------- *------------------------------------------------------------------------------------------------- @@ -254,22 +270,22 @@ typedef struct dim3 { * @returns #hipSuccess * * @see hipSetDevice, hipDeviceReset -*/ + */ hipError_t hipDeviceSynchronize(void); - /** * @brief The state of current device is discarded and updated to a fresh state. * - * Calling this function deletes all streams created, memory allocated, kernels running, events created. - * Make sure that no other thread is using the device or streams, memory, kernels, events associated with the current device. + * Calling this function deletes all streams created, memory allocated, kernels running, events + * created. Make sure that no other thread is using the device or streams, memory, kernels, events + * associated with the current device. * * @returns #hipSuccess * * @see hipDeviceSynchronize */ -hipError_t hipDeviceReset(void) ; +hipError_t hipDeviceReset(void); /** @@ -277,22 +293,27 @@ hipError_t hipDeviceReset(void) ; * * @param[in] deviceId Valid device in range 0...hipGetDeviceCount(). * - * Sets @p device as the default device for the calling host thread. Valid device id's are 0... (hipGetDeviceCount()-1). + * Sets @p device as the default device for the calling host thread. Valid device id's are 0... + * (hipGetDeviceCount()-1). * * Many HIP APIs implicitly use the "default device" : * - * - Any device memory subsequently allocated from this host thread (using hipMalloc) will be allocated on device. + * - Any device memory subsequently allocated from this host thread (using hipMalloc) will be + * allocated on device. * - Any streams or events created from this host thread will be associated with device. - * - Any kernels launched from this host thread (using hipLaunchKernel) will be executed on device (unless a specific stream is specified, - * in which case the device associated with that stream will be used). + * - Any kernels launched from this host thread (using hipLaunchKernel) will be executed on device + * (unless a specific stream is specified, in which case the device associated with that stream will + * be used). * * This function may be called from any host thread. Multiple host threads may use the same device. - * This function does no synchronization with the previous or new device, and has very little runtime overhead. - * Applications can use hipSetDevice to quickly switch the default device before making a HIP runtime call which uses the default device. + * This function does no synchronization with the previous or new device, and has very little + * runtime overhead. Applications can use hipSetDevice to quickly switch the default device before + * making a HIP runtime call which uses the default device. * * The default device is stored in thread-local-storage for each thread. - * Thread-pool implementations may inherit the default device of the previous thread. A good practice is to always call hipSetDevice - * at the start of HIP coding sequency to establish a known standard device. + * Thread-pool implementations may inherit the default device of the previous thread. A good + * practice is to always call hipSetDevice at the start of HIP coding sequency to establish a known + * standard device. * * @returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorDeviceAlreadyInUse * @@ -314,7 +335,7 @@ hipError_t hipSetDevice(int deviceId); * * @see hipSetDevice, hipGetDevicesizeBytes */ -hipError_t hipGetDevice(int *deviceId); +hipError_t hipGetDevice(int* deviceId); /** @@ -325,10 +346,11 @@ hipError_t hipGetDevice(int *deviceId); * @returns #hipSuccess, #hipErrorNoDevice * * - * Returns in @p *count the number of devices that have ability to run compute commands. If there are no such devices, then @ref hipGetDeviceCount will return #hipErrorNoDevice. - * If 1 or more devices can be found, then hipGetDeviceCount returns #hipSuccess. + * Returns in @p *count the number of devices that have ability to run compute commands. If there + * are no such devices, then @ref hipGetDeviceCount will return #hipErrorNoDevice. If 1 or more + * devices can be found, then hipGetDeviceCount returns #hipSuccess. */ -hipError_t hipGetDeviceCount(int *count); +hipError_t hipGetDeviceCount(int* count); /** * @brief Query for a specific device attribute. @@ -363,10 +385,11 @@ hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId); * @param [in] cacheConfig * * @returns #hipSuccess, #hipErrorInitializationError - * Note: AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is ignored on those architectures. + * Note: AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is ignored + * on those architectures. * */ -hipError_t hipDeviceSetCacheConfig ( hipFuncCache_t cacheConfig ); +hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig); /** @@ -375,10 +398,11 @@ hipError_t hipDeviceSetCacheConfig ( hipFuncCache_t cacheConfig ); * @param [in] cacheConfig * * @returns #hipSuccess, #hipErrorInitializationError - * Note: AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is ignored on those architectures. + * Note: AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is ignored + * on those architectures. * */ -hipError_t hipDeviceGetCacheConfig ( hipFuncCache_t *cacheConfig ); +hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* cacheConfig); /** * @brief Get Resource limits of current device @@ -390,7 +414,7 @@ hipError_t hipDeviceGetCacheConfig ( hipFuncCache_t *cacheConfig ); * Note: Currently, only hipLimitMallocHeapSize is available * */ -hipError_t hipDeviceGetLimit(size_t *pValue, enum hipLimit_t limit); +hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit); /** @@ -399,10 +423,11 @@ hipError_t hipDeviceGetLimit(size_t *pValue, enum hipLimit_t limit); * @param [in] config; * * @returns #hipSuccess, #hipErrorInitializationError - * Note: AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is ignored on those architectures. + * Note: AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is ignored + * on those architectures. * */ -hipError_t hipFuncSetCacheConfig (const void* func, hipFuncCache_t config ); +hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config); /** * @brief Returns bank width of shared memory for current device @@ -411,10 +436,11 @@ hipError_t hipFuncSetCacheConfig (const void* func, hipFuncCache_t config ); * * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorInitializationError * - * Note: AMD devices and some Nvidia GPUS do not support shared cache banking, and the hint is ignored on those architectures. + * Note: AMD devices and some Nvidia GPUS do not support shared cache banking, and the hint is + * ignored on those architectures. * */ -hipError_t hipDeviceGetSharedMemConfig ( hipSharedMemConfig * pConfig ); +hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig* pConfig); /** @@ -424,10 +450,11 @@ hipError_t hipDeviceGetSharedMemConfig ( hipSharedMemConfig * pConfig ); * * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorInitializationError * - * Note: AMD devices and some Nvidia GPUS do not support shared cache banking, and the hint is ignored on those architectures. + * Note: AMD devices and some Nvidia GPUS do not support shared cache banking, and the hint is + * ignored on those architectures. * */ -hipError_t hipDeviceSetSharedMemConfig ( hipSharedMemConfig config ); +hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config); /** * @brief The current device behavior is changed according the flags passed. @@ -435,20 +462,25 @@ hipError_t hipDeviceSetSharedMemConfig ( hipSharedMemConfig config ); * @param [in] flags * * The schedule flags impact how HIP waits for the completion of a command running on a device. - * hipDeviceScheduleSpin : HIP runtime will actively spin in the thread which submitted the work until the command completes. This offers the lowest latency, but will consume a CPU core and may increase power. - * hipDeviceScheduleYield : The HIP runtime will yield the CPU to system so that other tasks can use it. This may increase latency to detect the completion but will consume less power and is friendlier to other tasks in the system. + * hipDeviceScheduleSpin : HIP runtime will actively spin in the thread which submitted the + * work until the command completes. This offers the lowest latency, but will consume a CPU core + * and may increase power. hipDeviceScheduleYield : The HIP runtime will yield the CPU to + * system so that other tasks can use it. This may increase latency to detect the completion but + * will consume less power and is friendlier to other tasks in the system. * hipDeviceScheduleBlockingSync : On ROCm platform, this is a synonym for hipDeviceScheduleYield. - * hipDeviceScheduleAuto : Use a hueristic to select between Spin and Yield modes. If the number of HIP contexts is greater than the number of logical processors in the system, use Spin scheduling. Else use Yield scheduling. + * hipDeviceScheduleAuto : Use a hueristic to select between Spin and Yield modes. If the + * number of HIP contexts is greater than the number of logical processors in the system, use Spin + * scheduling. Else use Yield scheduling. * * - * hipDeviceMapHost : Allow mapping host memory. On ROCM, this is always allowed and the flag is ignored. - * hipDeviceLmemResizeToMax : @warning ROCm silently ignores this flag. + * hipDeviceMapHost : Allow mapping host memory. On ROCM, this is always allowed and + * the flag is ignored. hipDeviceLmemResizeToMax : @warning ROCm silently ignores this flag. * * @returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorSetOnActiveProcess * * -*/ -hipError_t hipSetDeviceFlags ( unsigned flags); + */ +hipError_t hipSetDeviceFlags(unsigned flags); /** * @brief Device which matches hipDeviceProp_t is returned @@ -458,7 +490,7 @@ hipError_t hipSetDeviceFlags ( unsigned flags); * * @returns #hipSuccess, #hipErrorInvalidValue */ -hipError_t hipChooseDevice(int *device, const hipDeviceProp_t* prop); +hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop); // end doxygen Device /** @@ -473,12 +505,13 @@ hipError_t hipChooseDevice(int *device, const hipDeviceProp_t* prop); */ /** - * @brief Return last error returned by any HIP runtime API call and resets the stored error code to #hipSuccess + * @brief Return last error returned by any HIP runtime API call and resets the stored error code to + * #hipSuccess * * @returns return code from last HIP called from the active host thread * - * Returns the last error that has been returned by any of the runtime calls in the same host thread, - * and then resets the saved error to #hipSuccess. + * Returns the last error that has been returned by any of the runtime calls in the same host + * thread, and then resets the saved error to #hipSuccess. * * @see hipGetErrorString, hipGetLastError, hipPeakAtLastError, hipError_t */ @@ -490,15 +523,14 @@ hipError_t hipGetLastError(void); * * @return #hipSuccess * - * Returns the last error that has been returned by any of the runtime calls in the same host thread. - * Unlike hipGetLastError, this function does not reset the saved error code. + * Returns the last error that has been returned by any of the runtime calls in the same host + * thread. Unlike hipGetLastError, this function does not reset the saved error code. * * @see hipGetErrorString, hipGetLastError, hipPeakAtLastError, hipError_t */ hipError_t hipPeekAtLastError(void); - /** * @brief Return name of the specified error code in text form. * @@ -507,7 +539,7 @@ hipError_t hipPeekAtLastError(void); * * @see hipGetErrorString, hipGetLastError, hipPeakAtLastError, hipError_t */ -const char *hipGetErrorName(hipError_t hip_error); +const char* hipGetErrorName(hipError_t hip_error); /** @@ -520,7 +552,7 @@ const char *hipGetErrorName(hipError_t hip_error); * * @see hipGetErrorName, hipGetLastError, hipPeakAtLastError, hipError_t */ -const char *hipGetErrorString(hipError_t hipError); +const char* hipGetErrorString(hipError_t hipError); // end doxygen Error /** @@ -528,7 +560,6 @@ const char *hipGetErrorString(hipError_t hipError); */ - /** *------------------------------------------------------------------------------------------------- *------------------------------------------------------------------------------------------------- @@ -539,24 +570,26 @@ const char *hipGetErrorString(hipError_t hipError); * - cudaStreamAttachMemAsync * - cudaStreamCreateWithPriority * - cudaStreamGetPriority - */ + */ /** * @brief Create an asynchronous stream. * - * @param[in, out] stream Valid pointer to hipStream_t. This function writes the memory with the newly created stream. + * @param[in, out] stream Valid pointer to hipStream_t. This function writes the memory with the + * newly created stream. * @return #hipSuccess, #hipErrorInvalidValue * - * Create a new asynchronous stream. @p stream returns an opaque handle that can be used to reference the newly - * created stream in subsequent hipStream* commands. The stream is allocated on the heap and will remain allocated - * even if the handle goes out-of-scope. To release the memory used by the stream, applicaiton must call hipStreamDestroy. + * Create a new asynchronous stream. @p stream returns an opaque handle that can be used to + * reference the newly created stream in subsequent hipStream* commands. The stream is allocated on + * the heap and will remain allocated even if the handle goes out-of-scope. To release the memory + * used by the stream, applicaiton must call hipStreamDestroy. * * @return #hipSuccess, #hipErrorInvalidValue * * @see hipStreamCreateWithFlags, hipStreamSynchronize, hipStreamWaitEvent, hipStreamDestroy */ -hipError_t hipStreamCreate(hipStream_t *stream); +hipError_t hipStreamCreate(hipStream_t* stream); /** @@ -566,47 +599,54 @@ hipError_t hipStreamCreate(hipStream_t *stream); * @param[in ] flags to control stream creation. * @return #hipSuccess, #hipErrorInvalidValue * - * Create a new asynchronous stream. @p stream returns an opaque handle that can be used to reference the newly - * created stream in subsequent hipStream* commands. The stream is allocated on the heap and will remain allocated - * even if the handle goes out-of-scope. To release the memory used by the stream, applicaiton must call hipStreamDestroy. - * Flags controls behavior of the stream. See #hipStreamDefault, #hipStreamNonBlocking. + * Create a new asynchronous stream. @p stream returns an opaque handle that can be used to + * reference the newly created stream in subsequent hipStream* commands. The stream is allocated on + * the heap and will remain allocated even if the handle goes out-of-scope. To release the memory + * used by the stream, applicaiton must call hipStreamDestroy. Flags controls behavior of the + * stream. See #hipStreamDefault, #hipStreamNonBlocking. * * * @see hipStreamCreate, hipStreamSynchronize, hipStreamWaitEvent, hipStreamDestroy */ -hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags); +hipError_t hipStreamCreateWithFlags(hipStream_t* stream, unsigned int flags); /** * @brief Destroys the specified stream. * - * @param[in, out] stream Valid pointer to hipStream_t. This function writes the memory with the newly created stream. + * @param[in, out] stream Valid pointer to hipStream_t. This function writes the memory with the + * newly created stream. * @return #hipSuccess #hipErrorInvalidResourceHandle * * Destroys the specified stream. * - * If commands are still executing on the specified stream, some may complete execution before the queue is deleted. + * If commands are still executing on the specified stream, some may complete execution before the + * queue is deleted. * - * The queue may be destroyed while some commands are still inflight, or may wait for all commands queued to the stream - * before destroying it. + * The queue may be destroyed while some commands are still inflight, or may wait for all commands + * queued to the stream before destroying it. * - * @see hipStreamCreate, hipStreamCreateWithFlags, hipStreamQuery, hipStreamWaitEvent, hipStreamSynchronize + * @see hipStreamCreate, hipStreamCreateWithFlags, hipStreamQuery, hipStreamWaitEvent, + * hipStreamSynchronize */ hipError_t hipStreamDestroy(hipStream_t stream); /** - * @brief Return #hipSuccess if all of the operations in the specified @p stream have completed, or #hipErrorNotReady if not. + * @brief Return #hipSuccess if all of the operations in the specified @p stream have completed, or + * #hipErrorNotReady if not. * * @param[in] stream stream to query * * @return #hipSuccess, #hipErrorNotReady, #hipErrorInvalidResourceHandle * - * This is thread-safe and returns a snapshot of the current state of the queue. However, if other host threads are sending work to the stream, - * the status may change immediately after the function is called. It is typically used for debug. + * This is thread-safe and returns a snapshot of the current state of the queue. However, if other + * host threads are sending work to the stream, the status may change immediately after the function + * is called. It is typically used for debug. * - * @see hipStreamCreate, hipStreamCreateWithFlags, hipStreamWaitEvent, hipStreamSynchronize, hipStreamDestroy + * @see hipStreamCreate, hipStreamCreateWithFlags, hipStreamWaitEvent, hipStreamSynchronize, + * hipStreamDestroy */ hipError_t hipStreamQuery(hipStream_t stream); @@ -620,10 +660,12 @@ hipError_t hipStreamQuery(hipStream_t stream); * * This command is host-synchronous : the host will block until the specified stream is empty. * - * This command follows standard null-stream semantics. Specifically, specifying the null stream will cause the - * command to wait for other streams on the same device to complete all pending operations. + * This command follows standard null-stream semantics. Specifically, specifying the null stream + * will cause the command to wait for other streams on the same device to complete all pending + * operations. * - * This command honors the hipDeviceLaunchBlocking flag, which controls whether the wait is active or blocking. + * This command honors the hipDeviceLaunchBlocking flag, which controls whether the wait is active + * or blocking. * * @see hipStreamCreate, hipStreamCreateWithFlags, hipStreamWaitEvent, hipStreamDestroy * @@ -641,18 +683,18 @@ hipError_t hipStreamSynchronize(hipStream_t stream); * @return #hipSuccess, #hipErrorInvalidResourceHandle * * This function inserts a wait operation into the specified stream. - * All future work submitted to @p stream will wait until @p event reports completion before beginning execution. + * All future work submitted to @p stream will wait until @p event reports completion before + * beginning execution. * - * This function only waits for commands in the current stream to complete. Notably,, this function does - * not impliciy wait for commands in the default stream to complete, even if the specified stream is - * created with hipStreamNonBlocking = 0. + * This function only waits for commands in the current stream to complete. Notably,, this function + * does not impliciy wait for commands in the default stream to complete, even if the specified + * stream is created with hipStreamNonBlocking = 0. * * @see hipStreamCreate, hipStreamCreateWithFlags, hipStreamSynchronize, hipStreamDestroy */ hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags); - /** * @brief Return flags associated with this stream. * @@ -666,12 +708,12 @@ hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int * * @see hipStreamCreateWithFlags */ -hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int *flags); +hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags); /** * Stream CallBack struct */ -typedef void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData); +typedef void (*hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData); /** * @brief Adds a callback to be called on the host after all currently enqueued @@ -684,10 +726,12 @@ typedef void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void * @param[in] flags - Reserved for future use, must be 0 * @return #hipSuccess, #hipErrorInvalidResourceHandle, #hipErrorNotSupported * - * @see hipStreamCreate, hipStreamCreateWithFlags, hipStreamQuery, hipStreamSynchronize, hipStreamWaitEvent, hipStreamDestroy + * @see hipStreamCreate, hipStreamCreateWithFlags, hipStreamQuery, hipStreamSynchronize, + * hipStreamWaitEvent, hipStreamDestroy * */ -hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void *userData, unsigned int flags); +hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void* userData, + unsigned int flags); // end doxygen Stream @@ -696,8 +740,6 @@ hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback */ - - /** *------------------------------------------------------------------------------------------------- *------------------------------------------------------------------------------------------------- @@ -709,15 +751,23 @@ hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback * @brief Create an event with the specified flags * * @param[in,out] event Returns the newly created event. - * @param[in] flags Flags to control event behavior. Valid values are #hipEventDefault, #hipEventBlockingSync, #hipEventDisableTiming, #hipEventInterprocess + * @param[in] flags Flags to control event behavior. Valid values are #hipEventDefault, + #hipEventBlockingSync, #hipEventDisableTiming, #hipEventInterprocess - * #hipEventDefault : Default flag. The event will use active synchronization and will support timing. Blocking synchronization provides lowest possible latency at the expense of dedicating a CPU to poll on the eevent. - * #hipEventBlockingSync : The event will use blocking synchronization : if hipEventSynchronize is called on this event, the thread will block until the event completes. This can increase latency for the synchroniation but can result in lower power and more resources for other CPU threads. - * #hipEventDisableTiming : Disable recording of timing information. On ROCM platform, timing information is always recorded and this flag has no performance benefit. + * #hipEventDefault : Default flag. The event will use active synchronization and will support + timing. Blocking synchronization provides lowest possible latency at the expense of dedicating a + CPU to poll on the eevent. + * #hipEventBlockingSync : The event will use blocking synchronization : if hipEventSynchronize is + called on this event, the thread will block until the event completes. This can increase latency + for the synchroniation but can result in lower power and more resources for other CPU threads. + * #hipEventDisableTiming : Disable recording of timing information. On ROCM platform, timing + information is always recorded and this flag has no performance benefit. - * @warning On HCC platform, hipEventInterprocess support is under development. Use of this flag will return an error. + * @warning On HCC platform, hipEventInterprocess support is under development. Use of this flag + will return an error. * - * @returns #hipSuccess, #hipErrorInitializationError, #hipErrorInvalidValue, #hipErrorLaunchFailure, #hipErrorMemoryAllocation + * @returns #hipSuccess, #hipErrorInitializationError, #hipErrorInvalidValue, + #hipErrorLaunchFailure, #hipErrorMemoryAllocation * * @see hipEventCreate, hipEventSynchronize, hipEventDestroy, hipEventElapsedTime */ @@ -729,9 +779,11 @@ hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned flags); * * @param[in,out] event Returns the newly created event. * - * @returns #hipSuccess, #hipErrorInitializationError, #hipErrorInvalidValue, #hipErrorLaunchFailure, #hipErrorMemoryAllocation + * @returns #hipSuccess, #hipErrorInitializationError, #hipErrorInvalidValue, + * #hipErrorLaunchFailure, #hipErrorMemoryAllocation * - * @see hipEventCreateWithFlags, hipEventRecord, hipEventQuery, hipEventSynchronize, hipEventDestroy, hipEventElapsedTime + * @see hipEventCreateWithFlags, hipEventRecord, hipEventQuery, hipEventSynchronize, + * hipEventDestroy, hipEventElapsedTime */ hipError_t hipEventCreate(hipEvent_t* event); @@ -741,7 +793,8 @@ hipError_t hipEventCreate(hipEvent_t* event); * * @param[in] event event to record. * @param[in] stream stream in which to record event. - * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorInitializationError, #hipErrorInvalidResourceHandle, #hipErrorLaunchFailure + * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorInitializationError, + * #hipErrorInvalidResourceHandle, #hipErrorLaunchFailure * * hipEventQuery() or hipEventSynchronize() must be used to determine when the event * transitions from "recording" (after hipEventRecord() is called) to "recorded" @@ -752,12 +805,14 @@ hipError_t hipEventCreate(hipEvent_t* event); * the specified stream, after all previous * commands in that stream have completed executing. * - * If hipEventRecord() has been previously called on this event, then this call will overwrite any existing state in event. + * If hipEventRecord() has been previously called on this event, then this call will overwrite any + * existing state in event. * - * If this function is called on a an event that is currently being recorded, results are undefined - either - * outstanding recording may save state into the event, and the order is not guaranteed. + * If this function is called on a an event that is currently being recorded, results are undefined + * - either outstanding recording may save state into the event, and the order is not guaranteed. * - * @see hipEventCreate, hipEventCreateWithFlags, hipEventQuery, hipEventSynchronize, hipEventDestroy, hipEventElapsedTime + * @see hipEventCreate, hipEventCreateWithFlags, hipEventQuery, hipEventSynchronize, + * hipEventDestroy, hipEventElapsedTime * */ #ifdef __cplusplus @@ -770,12 +825,15 @@ hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream); * @brief Destroy the specified event. * * @param[in] event Event to destroy. - * @returns #hipSuccess, #hipErrorInitializationError, #hipErrorInvalidValue, #hipErrorLaunchFailure + * @returns #hipSuccess, #hipErrorInitializationError, #hipErrorInvalidValue, + * #hipErrorLaunchFailure * - * Releases memory associated with the event. If the event is recording but has not completed recording when hipEventDestroy() is called, - * the function will return immediately and the completion_future resources will be released later, when the hipDevice is synchronized. + * Releases memory associated with the event. If the event is recording but has not completed + * recording when hipEventDestroy() is called, the function will return immediately and the + * completion_future resources will be released later, when the hipDevice is synchronized. * - * @see hipEventCreate, hipEventCreateWithFlags, hipEventQuery, hipEventSynchronize, hipEventRecord, hipEventElapsedTime + * @see hipEventCreate, hipEventCreateWithFlags, hipEventQuery, hipEventSynchronize, hipEventRecord, + * hipEventElapsedTime * * @returns #hipSuccess */ @@ -785,16 +843,19 @@ hipError_t hipEventDestroy(hipEvent_t event); /** * @brief Wait for an event to complete. * - * This function will block until the event is ready, waiting for all previous work in the stream specified when event was recorded with hipEventRecord(). + * This function will block until the event is ready, waiting for all previous work in the stream + * specified when event was recorded with hipEventRecord(). * * If hipEventRecord() has not been called on @p event, this function returns immediately. * * TODO-hcc - This function needs to support hipEventBlockingSync parameter. * * @param[in] event Event on which to wait. - * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorInitializationError, #hipErrorInvalidResourceHandle, #hipErrorLaunchFailure + * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorInitializationError, + * #hipErrorInvalidResourceHandle, #hipErrorLaunchFailure * - * @see hipEventCreate, hipEventCreateWithFlags, hipEventQuery, hipEventDestroy, hipEventRecord, hipEventElapsedTime + * @see hipEventCreate, hipEventCreateWithFlags, hipEventQuery, hipEventDestroy, hipEventRecord, + * hipEventElapsedTime */ hipError_t hipEventSynchronize(hipEvent_t event); @@ -805,7 +866,8 @@ hipError_t hipEventSynchronize(hipEvent_t event); * @param[out] ms : Return time between start and stop in ms. * @param[in] start : Start event. * @param[in] stop : Stop event. - * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorNotReady, #hipErrorInvalidResourceHandle, #hipErrorInitializationError, #hipErrorLaunchFailure + * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorNotReady, #hipErrorInvalidResourceHandle, + * #hipErrorInitializationError, #hipErrorLaunchFailure * * Computes the elapsed time between two events. Time is computed in ms, with * a resolution of approximately 1 us. @@ -818,29 +880,33 @@ hipError_t hipEventSynchronize(hipEvent_t event); * commands in that stream have completed executing. Thus the time that * the event recorded may be significantly after the host calls hipEventRecord(). * - * If hipEventRecord() has not been called on either event, then #hipErrorInvalidResourceHandle is returned. - * If hipEventRecord() has been called on both events, but the timestamp has not yet been recorded on one or - * both events (that is, hipEventQuery() would return #hipErrorNotReady on at least one of the events), then - * #hipErrorNotReady is returned. + * If hipEventRecord() has not been called on either event, then #hipErrorInvalidResourceHandle is + * returned. If hipEventRecord() has been called on both events, but the timestamp has not yet been + * recorded on one or both events (that is, hipEventQuery() would return #hipErrorNotReady on at + * least one of the events), then #hipErrorNotReady is returned. * - * @see hipEventCreate, hipEventCreateWithFlags, hipEventQuery, hipEventDestroy, hipEventRecord, hipEventSynchronize + * @see hipEventCreate, hipEventCreateWithFlags, hipEventQuery, hipEventDestroy, hipEventRecord, + * hipEventSynchronize */ -hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop); +hipError_t hipEventElapsedTime(float* ms, hipEvent_t start, hipEvent_t stop); /** * @brief Query event status * * @param[in] event Event to query. - * @returns #hipSuccess, #hipErrorNotReady, #hipErrorInvalidResourceHandle, #hipErrorInvalidValue, #hipErrorInitializationError, #hipErrorLaunchFailure + * @returns #hipSuccess, #hipErrorNotReady, #hipErrorInvalidResourceHandle, #hipErrorInvalidValue, + * #hipErrorInitializationError, #hipErrorLaunchFailure * - * Query the status of the specified event. This function will return #hipErrorNotReady if all commands - * in the appropriate stream (specified to hipEventRecord()) have completed. If that work has not completed, - * or if hipEventRecord() was not called on the event, then #hipSuccess is returned. + * Query the status of the specified event. This function will return #hipErrorNotReady if all + * commands in the appropriate stream (specified to hipEventRecord()) have completed. If that work + * has not completed, or if hipEventRecord() was not called on the event, then #hipSuccess is + * returned. * - * @see hipEventCreate, hipEventCreateWithFlags, hipEventRecord, hipEventDestroy, hipEventSynchronize, hipEventElapsedTime + * @see hipEventCreate, hipEventCreateWithFlags, hipEventRecord, hipEventDestroy, + * hipEventSynchronize, hipEventElapsedTime */ -hipError_t hipEventQuery(hipEvent_t event) ; +hipError_t hipEventQuery(hipEvent_t event); // end doxygen Events @@ -849,7 +915,6 @@ hipError_t hipEventQuery(hipEvent_t event) ; */ - /** *------------------------------------------------------------------------------------------------- *------------------------------------------------------------------------------------------------- @@ -875,7 +940,7 @@ hipError_t hipEventQuery(hipEvent_t event) ; * * @see hipGetDeviceCount, hipGetDevice, hipSetDevice, hipChooseDevice */ -hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, const void* ptr); +hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void* ptr); /** * @brief Allocate memory on the default accelerator @@ -887,9 +952,10 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, const void * * @return #hipSuccess, #hipErrorMemoryAllocation, #hipErrorInvalidValue (bad context, null *ptr) * - * @see hipMallocPitch, hipFree, hipMallocArray, hipFreeArray, hipMalloc3D, hipMalloc3DArray, hipHostFree, hipHostMalloc + * @see hipMallocPitch, hipFree, hipMallocArray, hipFreeArray, hipMalloc3D, hipMalloc3DArray, + * hipHostFree, hipHostMalloc */ -hipError_t hipMalloc(void** ptr, size_t size) ; +hipError_t hipMalloc(void** ptr, size_t size); /** * @brief Allocate pinned host memory [Deprecated] @@ -903,7 +969,8 @@ hipError_t hipMalloc(void** ptr, size_t size) ; * * @deprecated use hipHostMalloc() instead */ -hipError_t hipMallocHost(void** ptr, size_t size) __attribute__((deprecated("use hipHostMalloc instead"))) ; +hipError_t hipMallocHost(void** ptr, size_t size) + __attribute__((deprecated("use hipHostMalloc instead"))); /** * @brief Allocate device accessible page locked host memory @@ -918,7 +985,7 @@ hipError_t hipMallocHost(void** ptr, size_t size) __attribute__((deprecated("use * * @see hipSetDeviceFlags, hipHostFree */ -hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags) ; +hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags); /** * @brief Allocate device accessible page locked host memory [Deprecated] @@ -933,7 +1000,8 @@ hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags) ; * * @deprecated use hipHostMalloc() instead */ -hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags) __attribute__((deprecated("use hipHostMalloc instead"))) ; +hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags) + __attribute__((deprecated("use hipHostMalloc instead"))); /** * @brief Get Device pointer from Host Pointer allocated through hipHostMalloc @@ -946,7 +1014,7 @@ hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags) __attribute * * @see hipSetDeviceFlags, hipHostMalloc */ -hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags) ; +hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags); /** * @brief Return flags associated with host pointer @@ -957,7 +1025,7 @@ hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int fla * * @see hipHostMalloc */ -hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr) ; +hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr); /** * @brief Register host memory so it can be accessed from the current device. @@ -968,30 +1036,34 @@ hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr) ; * * Flags: * - #hipHostRegisterDefault Memory is Mapped and Portable - * - #hipHostRegisterPortable Memory is considered registered by all contexts. HIP only supports one context so this is always assumed true. - * - #hipHostRegisterMapped Map the allocation into the address space for the current device. The device pointer can be obtained with #hipHostGetDevicePointer. + * - #hipHostRegisterPortable Memory is considered registered by all contexts. HIP only supports + * one context so this is always assumed true. + * - #hipHostRegisterMapped Map the allocation into the address space for the current device. + * The device pointer can be obtained with #hipHostGetDevicePointer. * * * After registering the memory, use #hipHostGetDevicePointer to obtain the mapped device pointer. - * On many systems, the mapped device pointer will have a different value than the mapped host pointer. Applications - * must use the device pointer in device code, and the host pointer in device code. + * On many systems, the mapped device pointer will have a different value than the mapped host + * pointer. Applications must use the device pointer in device code, and the host pointer in device + * code. * - * On some systems, registered memory is pinned. On some systems, registered memory may not be actually be pinned - * but uses OS or hardware facilities to all GPU access to the host memory. + * On some systems, registered memory is pinned. On some systems, registered memory may not be + * actually be pinned but uses OS or hardware facilities to all GPU access to the host memory. * - * Developers are strongly encouraged to register memory blocks which are aligned to the host cache-line size. - * (typically 64-bytes but can be obtains from the CPUID instruction). + * Developers are strongly encouraged to register memory blocks which are aligned to the host + * cache-line size. (typically 64-bytes but can be obtains from the CPUID instruction). * - * If registering non-aligned pointers, the application must take care when register pointers from the same cache line - * on different devices. HIP's coarse-grained synchronization model does not guarantee correct results if different - * devices write to different parts of the same cache block - typically one of the writes will "win" and overwrite data - * from the other registered memory region. + * If registering non-aligned pointers, the application must take care when register pointers from + * the same cache line on different devices. HIP's coarse-grained synchronization model does not + * guarantee correct results if different devices write to different parts of the same cache block - + * typically one of the writes will "win" and overwrite data from the other registered memory + * region. * * @return #hipSuccess, #hipErrorMemoryAllocation * * @see hipHostUnregister, hipHostGetFlags, hipHostGetDevicePointer */ -hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags) ; +hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags); /** * @brief Un-register host pointer @@ -1001,7 +1073,7 @@ hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags) * * @see hipHostRegister */ -hipError_t hipHostUnregister(void* hostPtr) ; +hipError_t hipHostUnregister(void* hostPtr); /** * Allocates at least width (in bytes) * height bytes of linear memory @@ -1018,7 +1090,8 @@ hipError_t hipHostUnregister(void* hostPtr) ; * * @return Error code * - * @see hipMalloc, hipFree, hipMallocArray, hipFreeArray, hipHostFree, hipMalloc3D, hipMalloc3DArray, hipHostMalloc + * @see hipMalloc, hipFree, hipMallocArray, hipFreeArray, hipHostFree, hipMalloc3D, + * hipMalloc3DArray, hipHostMalloc */ hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t height); @@ -1030,9 +1103,11 @@ hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t height * * @param[in] ptr Pointer to memory to be freed * @return #hipSuccess - * @return #hipErrorInvalidDevicePointer (if pointer is invalid, including host pointers allocated with hipHostMalloc) + * @return #hipErrorInvalidDevicePointer (if pointer is invalid, including host pointers allocated + * with hipHostMalloc) * - * @see hipMalloc, hipMallocPitch, hipMallocArray, hipFreeArray, hipHostFree, hipMalloc3D, hipMalloc3DArray, hipHostMalloc + * @see hipMalloc, hipMallocPitch, hipMallocArray, hipFreeArray, hipHostFree, hipMalloc3D, + * hipMalloc3DArray, hipHostMalloc */ hipError_t hipFree(void* ptr); @@ -1041,7 +1116,8 @@ hipError_t hipFree(void* ptr); * * @param[in] ptr Pointer to memory to be freed * @return #hipSuccess, - * #hipErrorInvalidValue (if pointer is invalid, including device pointers allocated with hipMalloc) + * #hipErrorInvalidValue (if pointer is invalid, including device pointers allocated with + hipMalloc) * @deprecated use hipHostFree() instead */ @@ -1054,9 +1130,11 @@ hipError_t hipFreeHost(void* ptr) __attribute__((deprecated("use hipHostFree ins * * @param[in] ptr Pointer to memory to be freed * @return #hipSuccess, - * #hipErrorInvalidValue (if pointer is invalid, including device pointers allocated with hipMalloc) + * #hipErrorInvalidValue (if pointer is invalid, including device pointers allocated with + * hipMalloc) * - * @see hipMalloc, hipMallocPitch, hipFree, hipMallocArray, hipFreeArray, hipMalloc3D, hipMalloc3DArray, hipHostMalloc + * @see hipMalloc, hipMallocPitch, hipFree, hipMallocArray, hipFreeArray, hipMalloc3D, + * hipMalloc3DArray, hipHostMalloc */ hipError_t hipHostFree(void* ptr); @@ -1068,10 +1146,11 @@ hipError_t hipHostFree(void* ptr); * The src and dst must not overlap. * * For hipMemcpy, the copy is always performed by the current device (set by hipSetDevice). - * For multi-gpu or peer-to-peer configurations, it is recommended to set the current device to the device where the src data is physically located. - * For optimal peer-to-peer copies, the copy device must be able to access the src and dst pointers (by calling hipDeviceEnablePeerAccess with copy agent as the - * current device and src/dest as the peerDevice argument. if this is not done, the hipMemcpy will still work, but will perform the copy using a staging buffer - * on the host. + * For multi-gpu or peer-to-peer configurations, it is recommended to set the current device to the + * device where the src data is physically located. For optimal peer-to-peer copies, the copy device + * must be able to access the src and dst pointers (by calling hipDeviceEnablePeerAccess with copy + * agent as the current device and src/dest as the peerDevice argument. if this is not done, the + * hipMemcpy will still work, but will perform the copy using a staging buffer on the host. * * @param[out] dst Data being copy to * @param[in] src Data being copy from @@ -1079,7 +1158,12 @@ hipError_t hipHostFree(void* ptr); * @param[in] copyType Memory copy type * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknowni * - * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, hipMemHostAlloc, hipMemHostGetDevicePointer + * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, + * hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, + * hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, + * hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, + * hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, + * hipMemHostAlloc, hipMemHostGetDevicePointer */ hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind); @@ -1090,9 +1174,15 @@ hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind * @param[in] src Data being copy from * @param[in] sizeBytes Data size in bytes * - * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, #hipErrorInvalidValue + * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, + * #hipErrorInvalidValue * - * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, hipMemHostAlloc, hipMemHostGetDevicePointer + * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, + * hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, + * hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, + * hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, + * hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, + * hipMemHostAlloc, hipMemHostGetDevicePointer */ hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes); @@ -1103,9 +1193,15 @@ hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes); * @param[in] src Data being copy from * @param[in] sizeBytes Data size in bytes * - * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, #hipErrorInvalidValue + * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, + * #hipErrorInvalidValue * - * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, hipMemHostAlloc, hipMemHostGetDevicePointer + * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, + * hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, + * hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, + * hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, + * hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, + * hipMemHostAlloc, hipMemHostGetDevicePointer */ hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes); @@ -1116,9 +1212,15 @@ hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes); * @param[in] src Data being copy from * @param[in] sizeBytes Data size in bytes * - * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, #hipErrorInvalidValue + * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, + * #hipErrorInvalidValue * - * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, hipMemHostAlloc, hipMemHostGetDevicePointer + * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, + * hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, + * hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, + * hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, + * hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, + * hipMemHostAlloc, hipMemHostGetDevicePointer */ hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes); @@ -1129,9 +1231,15 @@ hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeByte * @param[in] src Data being copy from * @param[in] sizeBytes Data size in bytes * - * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, #hipErrorInvalidValue + * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, + * #hipErrorInvalidValue * - * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, hipMemHostAlloc, hipMemHostGetDevicePointer + * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, + * hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, + * hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, + * hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, + * hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, + * hipMemHostAlloc, hipMemHostGetDevicePointer */ hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, hipStream_t stream); @@ -1142,9 +1250,15 @@ hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, h * @param[in] src Data being copy from * @param[in] sizeBytes Data size in bytes * - * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, #hipErrorInvalidValue + * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, + * #hipErrorInvalidValue * - * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, hipMemHostAlloc, hipMemHostGetDevicePointer + * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, + * hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, + * hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, + * hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, + * hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, + * hipMemHostAlloc, hipMemHostGetDevicePointer */ hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream); @@ -1155,19 +1269,29 @@ hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, h * @param[in] src Data being copy from * @param[in] sizeBytes Data size in bytes * - * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, #hipErrorInvalidValue + * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, + * #hipErrorInvalidValue * - * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, hipMemHostAlloc, hipMemHostGetDevicePointer + * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, + * hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned, hipMemcpyAtoA, + * hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync, hipMemcpyDtoA, hipMemcpyDtoD, + * hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync, hipMemcpyHtoA, hipMemcpyHtoAAsync, + * hipMemcpyHtoDAsync, hipMemFree, hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, + * hipMemHostAlloc, hipMemHostGetDevicePointer */ -hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream); +hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes, + hipStream_t stream); /** - * @brief Copies @p sizeBytes bytes from the memory area pointed to by @p src to the memory area pointed to by @p offset bytes from the start of symbol @p symbol. + * @brief Copies @p sizeBytes bytes from the memory area pointed to by @p src to the memory area + * pointed to by @p offset bytes from the start of symbol @p symbol. * - * The memory areas may not overlap. Symbol can either be a variable that resides in global or constant memory space, or it can be a character string, - * naming a variable that resides in global or constant memory space. Kind can be either hipMemcpyHostToDevice or hipMemcpyDeviceToDevice - * TODO: cudaErrorInvalidSymbol and cudaErrorInvalidMemcpyDirection is not supported, use hipErrorUnknown for now. + * The memory areas may not overlap. Symbol can either be a variable that resides in global or + * constant memory space, or it can be a character string, naming a variable that resides in global + * or constant memory space. Kind can be either hipMemcpyHostToDevice or hipMemcpyDeviceToDevice + * TODO: cudaErrorInvalidSymbol and cudaErrorInvalidMemcpyDirection is not supported, use + * hipErrorUnknown for now. * * @param[in] symbolName - Symbol destination on device * @param[in] src - Data being copy from @@ -1176,18 +1300,27 @@ hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t siz * @param[in] kind - Type of transfer * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown * - * @see hipMemcpy, hipMemcpy2D, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, hipMemcpy2DFromArray, hipMemcpyArrayToArray, hipMemcpy2DArrayToArray, hipMemcpyFromSymbol, hipMemcpyAsync, hipMemcpy2DAsync, hipMemcpyToArrayAsync, hipMemcpy2DToArrayAsync, hipMemcpyFromArrayAsync, hipMemcpy2DFromArrayAsync, hipMemcpyToSymbolAsync, hipMemcpyFromSymbolAsync + * @see hipMemcpy, hipMemcpy2D, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, + * hipMemcpy2DFromArray, hipMemcpyArrayToArray, hipMemcpy2DArrayToArray, hipMemcpyFromSymbol, + * hipMemcpyAsync, hipMemcpy2DAsync, hipMemcpyToArrayAsync, hipMemcpy2DToArrayAsync, + * hipMemcpyFromArrayAsync, hipMemcpy2DFromArrayAsync, hipMemcpyToSymbolAsync, + * hipMemcpyFromSymbolAsync */ -hipError_t hipMemcpyToSymbol(const void* symbolName, const void *src, size_t sizeBytes, size_t offset = 0, hipMemcpyKind kind = hipMemcpyHostToDevice); +hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src, size_t sizeBytes, + size_t offset = 0, hipMemcpyKind kind = hipMemcpyHostToDevice); /** - * @brief Copies @p sizeBytes bytes from the memory area pointed to by @p src to the memory area pointed to by @p offset bytes from the start of symbol @p symbol + * @brief Copies @p sizeBytes bytes from the memory area pointed to by @p src to the memory area + * pointed to by @p offset bytes from the start of symbol @p symbol * - * The memory areas may not overlap. Symbol can either be a variable that resides in global or constant memory space, or it can be a character string, - * naming a variable that resides in global or constant memory space. Kind can be either hipMemcpyHostToDevice or hipMemcpyDeviceToDevice - * hipMemcpyToSymbolAsync() is asynchronous with respect to the host, so the call may return before copy is complete. - * TODO: cudaErrorInvalidSymbol and cudaErrorInvalidMemcpyDirection is not supported, use hipErrorUnknown for now. + * The memory areas may not overlap. Symbol can either be a variable that resides in global or + * constant memory space, or it can be a character string, naming a variable that resides in global + * or constant memory space. Kind can be either hipMemcpyHostToDevice or hipMemcpyDeviceToDevice + * hipMemcpyToSymbolAsync() is asynchronous with respect to the host, so the call may return before + * copy is complete. + * TODO: cudaErrorInvalidSymbol and cudaErrorInvalidMemcpyDirection is not supported, use + * hipErrorUnknown for now. * * @param[in] symbolName - Symbol destination on device * @param[in] src - Data being copy from @@ -1196,27 +1329,36 @@ hipError_t hipMemcpyToSymbol(const void* symbolName, const void *src, size_t siz * @param[in] kind - Type of transfer * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown * - * @see hipMemcpy, hipMemcpy2D, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, hipMemcpy2DFromArray, hipMemcpyArrayToArray, hipMemcpy2DArrayToArray, hipMemcpyFromSymbol, hipMemcpyAsync, hipMemcpy2DAsync, hipMemcpyToArrayAsync, hipMemcpy2DToArrayAsync, hipMemcpyFromArrayAsync, hipMemcpy2DFromArrayAsync, hipMemcpyToSymbolAsync, hipMemcpyFromSymbolAsync + * @see hipMemcpy, hipMemcpy2D, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, + * hipMemcpy2DFromArray, hipMemcpyArrayToArray, hipMemcpy2DArrayToArray, hipMemcpyFromSymbol, + * hipMemcpyAsync, hipMemcpy2DAsync, hipMemcpyToArrayAsync, hipMemcpy2DToArrayAsync, + * hipMemcpyFromArrayAsync, hipMemcpy2DFromArrayAsync, hipMemcpyToSymbolAsync, + * hipMemcpyFromSymbolAsync */ -hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void *src, size_t sizeBytes, size_t offset, hipMemcpyKind kind, hipStream_t stream = 0); +hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src, size_t sizeBytes, + size_t offset, hipMemcpyKind kind, hipStream_t stream = 0); -hipError_t hipMemcpyFromSymbol(void *dst, const void* symbolName, size_t sizeBytes, size_t offset = 0, hipMemcpyKind kind = hipMemcpyDeviceToHost); +hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName, size_t sizeBytes, + size_t offset = 0, hipMemcpyKind kind = hipMemcpyDeviceToHost); -hipError_t hipMemcpyFromSymbolAsync(void *dst, const void* symbolName, size_t sizeBytes, size_t offset, hipMemcpyKind kind, hipStream_t stream = 0); +hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName, size_t sizeBytes, + size_t offset, hipMemcpyKind kind, hipStream_t stream = 0); /** * @brief Copy data from src to dst asynchronously. * - * @warning If host or dest are not pinned, the memory copy will be performed synchronously. For best performance, use hipHostMalloc to - * allocate host memory that is transferred asynchronously. + * @warning If host or dest are not pinned, the memory copy will be performed synchronously. For + * best performance, use hipHostMalloc to allocate host memory that is transferred asynchronously. * * @warning on HCC hipMemcpyAsync does not support overlapped H2D and D2H copies. * For hipMemcpy, the copy is always performed by the device associated with the specified stream. * - * For multi-gpu or peer-to-peer configurations, it is recommended to use a stream which is a attached to the device where the src data is physically located. - * For optimal peer-to-peer copies, the copy device must be able to access the src and dst pointers (by calling hipDeviceEnablePeerAccess with copy agent as the - * current device and src/dest as the peerDevice argument. if this is not done, the hipMemcpy will still work, but will perform the copy using a staging buffer - * on the host. + * For multi-gpu or peer-to-peer configurations, it is recommended to use a stream which is a + * attached to the device where the src data is physically located. For optimal peer-to-peer copies, + * the copy device must be able to access the src and dst pointers (by calling + * hipDeviceEnablePeerAccess with copy agent as the current device and src/dest as the peerDevice + * argument. if this is not done, the hipMemcpy will still work, but will perform the copy using a + * staging buffer on the host. * * @param[out] dst Data being copy to * @param[in] src Data being copy from @@ -1224,40 +1366,50 @@ hipError_t hipMemcpyFromSymbolAsync(void *dst, const void* symbolName, size_t si * @param[in] accelerator_view Accelerator view which the copy is being enqueued * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown * - * @see hipMemcpy, hipMemcpy2D, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, hipMemcpy2DFromArray, hipMemcpyArrayToArray, hipMemcpy2DArrayToArray, hipMemcpyToSymbol, hipMemcpyFromSymbol, hipMemcpy2DAsync, hipMemcpyToArrayAsync, hipMemcpy2DToArrayAsync, hipMemcpyFromArrayAsync, hipMemcpy2DFromArrayAsync, hipMemcpyToSymbolAsync, hipMemcpyFromSymbolAsync + * @see hipMemcpy, hipMemcpy2D, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, + * hipMemcpy2DFromArray, hipMemcpyArrayToArray, hipMemcpy2DArrayToArray, hipMemcpyToSymbol, + * hipMemcpyFromSymbol, hipMemcpy2DAsync, hipMemcpyToArrayAsync, hipMemcpy2DToArrayAsync, + * hipMemcpyFromArrayAsync, hipMemcpy2DFromArrayAsync, hipMemcpyToSymbolAsync, + * hipMemcpyFromSymbolAsync */ #if __cplusplus -hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind, hipStream_t stream=0); +hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind, + hipStream_t stream = 0); #else -hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind, hipStream_t stream); +hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind, + hipStream_t stream); #endif /** - * @brief Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant byte value value. + * @brief Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant + * byte value value. * * @param[out] dst Data being filled * @param[in] constant value to be set * @param[in] sizeBytes Data size in bytes * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorNotInitialized */ -hipError_t hipMemset(void* dst, int value, size_t sizeBytes ); +hipError_t hipMemset(void* dst, int value, size_t sizeBytes); /** - * @brief Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant byte value value. + * @brief Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant + * byte value value. * * @param[out] dst Data ptr to be filled * @param[in] constant value to be set * @param[in] sizeBytes Data size in bytes * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorNotInitialized */ -hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t sizeBytes ); +hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t sizeBytes); /** - * @brief Fills the first sizeBytes bytes of the memory area pointed to by dev with the constant byte value value. + * @brief Fills the first sizeBytes bytes of the memory area pointed to by dev with the constant + * byte value value. * - * hipMemsetAsync() is asynchronous with respect to the host, so the call may return before the memset is complete. - * The operation can optionally be associated to a stream by passing a non-zero stream argument. - * If stream is non-zero, the operation may overlap with operations in other streams. + * hipMemsetAsync() is asynchronous with respect to the host, so the call may return before the + * memset is complete. The operation can optionally be associated to a stream by passing a non-zero + * stream argument. If stream is non-zero, the operation may overlap with operations in other + * streams. * * @param[out] dst Pointer to device memory * @param[in] value - Value to set for each byte of specified memory @@ -1266,7 +1418,7 @@ hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t sizeByt * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree */ #if __cplusplus -hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream = 0 ); +hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream = 0); #else hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream); #endif @@ -1290,12 +1442,13 @@ hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t * * Returns in *free a snapshot of the current free memory. * @returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue - * @warning On HCC, the free memory only accounts for memory allocated by this process and may be optimistic. + * @warning On HCC, the free memory only accounts for memory allocated by this process and may be + *optimistic. **/ -hipError_t hipMemGetInfo (size_t * free, size_t * total) ; +hipError_t hipMemGetInfo(size_t* free, size_t* total); -hipError_t hipMemPtrGetInfo(void *ptr, size_t *size); +hipError_t hipMemPtrGetInfo(void* ptr, size_t* size); /** @@ -1311,17 +1464,17 @@ hipError_t hipMemPtrGetInfo(void *ptr, size_t *size); * @see hipMalloc, hipMallocPitch, hipFree, hipFreeArray, hipHostMalloc, hipHostFree */ #if __cplusplus -hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, - size_t width, size_t height = 0, unsigned int flags = hipArrayDefault); +hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, size_t width, + size_t height = 0, unsigned int flags = hipArrayDefault); #else -hipError_t hipMallocArray(hipArray** array, const struct hipChannelFormatDesc* desc, - size_t width, size_t height, unsigned int flags); +hipError_t hipMallocArray(hipArray** array, const struct hipChannelFormatDesc* desc, size_t width, + size_t height, unsigned int flags); #endif -hipError_t hipArrayCreate ( hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray ); +hipError_t hipArrayCreate(hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray); -hipError_t hipArray3DCreate(hipArray_t *array, const HIP_ARRAY_DESCRIPTOR* pAllocateArray ); +hipError_t hipArray3DCreate(hipArray_t* array, const HIP_ARRAY_DESCRIPTOR* pAllocateArray); -hipError_t hipMalloc3D (hipPitchedPtr* pitchedDevPtr, hipExtent extent ); +hipError_t hipMalloc3D(hipPitchedPtr* pitchedDevPtr, hipExtent extent); /** * @brief Frees an array on the device. @@ -1345,10 +1498,8 @@ hipError_t hipFreeArray(hipArray* array); * @see hipMalloc, hipMallocPitch, hipFree, hipFreeArray, hipHostMalloc, hipHostFree */ -hipError_t hipMalloc3DArray(hipArray_t *array, - const struct hipChannelFormatDesc* desc, - struct hipExtent extent, - unsigned int flags); +hipError_t hipMalloc3DArray(hipArray_t* array, const struct hipChannelFormatDesc* desc, + struct hipExtent extent, unsigned int flags); /** * @brief Copies data between host and device. * @@ -1359,11 +1510,14 @@ hipError_t hipMalloc3DArray(hipArray_t *array, * @param[in] width Width of matrix transfer (columns in bytes) * @param[in] height Height of matrix transfer (rows) * @param[in] kind Type of transfer - * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection + * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, + * #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection * - * @see hipMemcpy, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync + * @see hipMemcpy, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, hipMemcpyToSymbol, + * hipMemcpyAsync */ -hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind); +hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, + size_t height, hipMemcpyKind kind); hipError_t hipMemcpyParam2D(const hip_Memcpy2D* pCopy); /** @@ -1377,14 +1531,18 @@ hipError_t hipMemcpyParam2D(const hip_Memcpy2D* pCopy); * @param[in] height Height of matrix transfer (rows) * @param[in] kind Type of transfer * @param[in] stream Stream to use - * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection + * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, + * #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection * - * @see hipMemcpy, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync + * @see hipMemcpy, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, hipMemcpyToSymbol, + * hipMemcpyAsync */ #if __cplusplus -hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream = 0); +hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, + size_t height, hipMemcpyKind kind, hipStream_t stream = 0); #else -hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream); +hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, + size_t height, hipMemcpyKind kind, hipStream_t stream); #endif /** @@ -1397,9 +1555,11 @@ hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t sp * @param[in] width Width of matrix transfer (columns in bytes) * @param[in] height Height of matrix transfer (rows) * @param[in] kind Type of transfer - * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection + * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, + * #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection * - * @see hipMemcpy, hipMemcpyToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync + * @see hipMemcpy, hipMemcpyToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, + * hipMemcpyAsync */ hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind); @@ -1414,12 +1574,14 @@ hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, con * @param[in] width Width of matrix transfer (columns in bytes) * @param[in] height Height of matrix transfer (rows) * @param[in] kind Type of transfer - * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection + * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, + * #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection * - * @see hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync + * @see hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, + * hipMemcpyAsync */ -hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, - const void* src, size_t count, hipMemcpyKind kind); +hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src, + size_t count, hipMemcpyKind kind); /** * @brief Copies data between host and device. @@ -1430,12 +1592,14 @@ hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, * @param[in] hOffset Source starting Y offset * @param[in] count Size in bytes to copy * @param[in] kind Type of transfer - * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection + * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, + * #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection * - * @see hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync + * @see hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, + * hipMemcpyAsync */ hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset, - size_t count, hipMemcpyKind kind); + size_t count, hipMemcpyKind kind); /** * @brief Copies data between host and device. @@ -1444,9 +1608,11 @@ hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffs * @param[in] srcArray Source array * @param[in] srcoffset Offset in bytes of source array * @param[in] count Size of memory copy in bytes - * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection + * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, + * #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection * - * @see hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync + * @see hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, + * hipMemcpyAsync */ hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t count); @@ -1457,9 +1623,11 @@ hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t * @param[in] dstOffset Offset in bytes of destination array * @param[in] srcHost Source host pointer * @param[in] count Size of memory copy in bytes - * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection + * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, + * #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection * - * @see hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync + * @see hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, + * hipMemcpyAsync */ hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, size_t count); @@ -1467,11 +1635,13 @@ hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHo * @brief Copies data between host and device. * * @param[in] p 3D memory copy parameters - * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection + * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidPitchValue, + * #hipErrorInvalidDevicePointer, #hipErrorInvalidMemcpyDirection * - * @see hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync + * @see hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, + * hipMemcpyAsync */ -hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p); +hipError_t hipMemcpy3D(const struct hipMemcpy3DParms* p); // doxygen end Memory /** @@ -1479,7 +1649,6 @@ hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p); */ - /** *------------------------------------------------------------------------------------------------- *------------------------------------------------------------------------------------------------- @@ -1500,20 +1669,23 @@ hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p); * Returns "1" in @p canAccessPeer if the specified @p device is capable * of directly accessing memory physically located on peerDevice , or "0" if not. * - * Returns "0" in @p canAccessPeer if deviceId == peerDeviceId, and both are valid devices : a device is not a peer of itself. + * Returns "0" in @p canAccessPeer if deviceId == peerDeviceId, and both are valid devices : a + * device is not a peer of itself. * * @returns #hipSuccess, * @returns #hipErrorInvalidDevice if deviceId or peerDeviceId are not valid devices */ -hipError_t hipDeviceCanAccessPeer (int* canAccessPeer, int deviceId, int peerDeviceId); +hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int deviceId, int peerDeviceId); /** - * @brief Enable direct access from current device's virtual address space to memory allocations physically located on a peer device. + * @brief Enable direct access from current device's virtual address space to memory allocations + * physically located on a peer device. * - * Memory which already allocated on peer device will be mapped into the address space of the current device. In addition, all - * future memory allocations on peerDeviceId will be mapped into the address space of the current device when the memory is allocated. - * The peer memory remains accessible from the current device until a call to hipDeviceDisablePeerAccess or hipDeviceReset. + * Memory which already allocated on peer device will be mapped into the address space of the + * current device. In addition, all future memory allocations on peerDeviceId will be mapped into + * the address space of the current device when the memory is allocated. The peer memory remains + * accessible from the current device until a call to hipDeviceDisablePeerAccess or hipDeviceReset. * * * @param [in] peerDeviceId @@ -1522,19 +1694,21 @@ hipError_t hipDeviceCanAccessPeer (int* canAccessPeer, int deviceId, int peerDev * Returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue, * @returns #hipErrorPeerAccessAlreadyEnabled if peer access is already enabled for this device. */ -hipError_t hipDeviceEnablePeerAccess (int peerDeviceId, unsigned int flags); +hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags); /** - * @brief Disable direct access from current device's virtual address space to memory allocations physically located on a peer device. + * @brief Disable direct access from current device's virtual address space to memory allocations + * physically located on a peer device. * - * Returns hipErrorPeerAccessNotEnabled if direct access to memory on peerDevice has not yet been enabled from the current device. + * Returns hipErrorPeerAccessNotEnabled if direct access to memory on peerDevice has not yet been + * enabled from the current device. * * @param [in] peerDeviceId * * @returns #hipSuccess, #hipErrorPeerAccessNotEnabled */ -hipError_t hipDeviceDisablePeerAccess (int peerDeviceId); +hipError_t hipDeviceDisablePeerAccess(int peerDeviceId); /** * @brief Get information on memory allocations. @@ -1545,15 +1719,16 @@ hipError_t hipDeviceDisablePeerAccess (int peerDeviceId); * * @returns #hipSuccess, #hipErrorInvalidDevicePointer * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ -hipError_t hipMemGetAddressRange ( hipDeviceptr_t* pbase, size_t* psize, hipDeviceptr_t dptr ); +hipError_t hipMemGetAddressRange(hipDeviceptr_t* pbase, size_t* psize, hipDeviceptr_t dptr); #ifndef USE_PEER_NON_UNIFIED #define USE_PEER_NON_UNIFIED 1 #endif -#if USE_PEER_NON_UNIFIED==1 +#if USE_PEER_NON_UNIFIED == 1 /** * @brief Copies memory from one device to memory on another device. * @@ -1565,7 +1740,8 @@ hipError_t hipMemGetAddressRange ( hipDeviceptr_t* pbase, size_t* psize, hipDevi * * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidDevice */ -hipError_t hipMemcpyPeer (void* dst, int dstDeviceId, const void* src, int srcDeviceId, size_t sizeBytes); +hipError_t hipMemcpyPeer(void* dst, int dstDeviceId, const void* src, int srcDeviceId, + size_t sizeBytes); /** * @brief Copies memory from one device to memory on another device. @@ -1580,9 +1756,11 @@ hipError_t hipMemcpyPeer (void* dst, int dstDeviceId, const void* src, int srcDe * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidDevice */ #if __cplusplus -hipError_t hipMemcpyPeerAsync ( void* dst, int dstDeviceId, const void* src, int srcDevice, size_t sizeBytes, hipStream_t stream=0 ); +hipError_t hipMemcpyPeerAsync(void* dst, int dstDeviceId, const void* src, int srcDevice, + size_t sizeBytes, hipStream_t stream = 0); #else -hipError_t hipMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, size_t sizeBytes, hipStream_t stream); +hipError_t hipMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int srcDevice, + size_t sizeBytes, hipStream_t stream); #endif #endif @@ -1607,7 +1785,7 @@ hipError_t hipMemcpyPeerAsync(void* dst, int dstDevice, const void* src, int src * This API provides control over the timing of the initialization. */ // TODO-ctx - more description on error codes. -hipError_t hipInit(unsigned int flags) ; +hipError_t hipInit(unsigned int flags); /** @@ -1626,9 +1804,10 @@ hipError_t hipInit(unsigned int flags) ; * * @return #hipSuccess * - * @see hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxPushCurrent, + * hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ -hipError_t hipCtxCreate(hipCtx_t *ctx, unsigned int flags, hipDevice_t device); +hipError_t hipCtxCreate(hipCtx_t* ctx, unsigned int flags, hipDevice_t device); /** * @brief Destroy a HIP context. @@ -1637,7 +1816,8 @@ hipError_t hipCtxCreate(hipCtx_t *ctx, unsigned int flags, hipDevice_t device); * * @returns #hipSuccess, #hipErrorInvalidValue * - * @see hipCtxCreate, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent,hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize , hipCtxGetDevice + * @see hipCtxCreate, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent,hipCtxSetCurrent, + * hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize , hipCtxGetDevice */ hipError_t hipCtxDestroy(hipCtx_t ctx); @@ -1648,7 +1828,8 @@ hipError_t hipCtxDestroy(hipCtx_t ctx); * * @returns #hipSuccess, #hipErrorInvalidContext * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxSetCurrent, hipCtxGetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxSetCurrent, hipCtxGetCurrent, + * hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ hipError_t hipCtxPopCurrent(hipCtx_t* ctx); @@ -1659,7 +1840,8 @@ hipError_t hipCtxPopCurrent(hipCtx_t* ctx); * * @returns #hipSuccess, #hipErrorInvalidContext * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize , hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize , hipCtxGetDevice */ hipError_t hipCtxPushCurrent(hipCtx_t ctx); @@ -1670,7 +1852,8 @@ hipError_t hipCtxPushCurrent(hipCtx_t ctx); * * @returns #hipSuccess, #hipErrorInvalidContext * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize , hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize , hipCtxGetDevice */ hipError_t hipCtxSetCurrent(hipCtx_t ctx); @@ -1681,7 +1864,8 @@ hipError_t hipCtxSetCurrent(hipCtx_t ctx); * * @returns #hipSuccess, #hipErrorInvalidContext * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetDevice, hipCtxGetFlags, hipCtxPopCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetDevice, hipCtxGetFlags, hipCtxPopCurrent, + * hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ hipError_t hipCtxGetCurrent(hipCtx_t* ctx); @@ -1692,10 +1876,11 @@ hipError_t hipCtxGetCurrent(hipCtx_t* ctx); * * @returns #hipSuccess, #hipErrorInvalidContext * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize */ -hipError_t hipCtxGetDevice(hipDevice_t *device); +hipError_t hipCtxGetDevice(hipDevice_t* device); /** * @brief Returns the approximate HIP api version. @@ -1711,9 +1896,10 @@ hipError_t hipCtxGetDevice(hipDevice_t *device); * HIP apps code should not rely on the api revision number here and should * use arch feature flags to test device capabilities or conditional compilation. * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetDevice, hipCtxGetFlags, hipCtxPopCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetDevice, hipCtxGetFlags, hipCtxPopCurrent, + * hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ -hipError_t hipCtxGetApiVersion (hipCtx_t ctx,int *apiVersion); +hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int* apiVersion); /** * @brief Set Cache configuration for a specific function @@ -1722,11 +1908,13 @@ hipError_t hipCtxGetApiVersion (hipCtx_t ctx,int *apiVersion); * * @return #hipSuccess * - * @warning AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is ignored on those architectures. + * @warning AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is + * ignored on those architectures. * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ -hipError_t hipCtxGetCacheConfig ( hipFuncCache_t *cacheConfig ); +hipError_t hipCtxGetCacheConfig(hipFuncCache_t* cacheConfig); /** * @brief Set L1/Shared cache partition. @@ -1735,11 +1923,13 @@ hipError_t hipCtxGetCacheConfig ( hipFuncCache_t *cacheConfig ); * * @return #hipSuccess * - * @warning AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is ignored on those architectures. + * @warning AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is + * ignored on those architectures. * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ -hipError_t hipCtxSetCacheConfig ( hipFuncCache_t cacheConfig ); +hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig); /** * @brief Set Shared memory bank configuration. @@ -1748,11 +1938,13 @@ hipError_t hipCtxSetCacheConfig ( hipFuncCache_t cacheConfig ); * * @return #hipSuccess * - * @warning AMD devices and some Nvidia GPUS do not support shared cache banking, and the hint is ignored on those architectures. + * @warning AMD devices and some Nvidia GPUS do not support shared cache banking, and the hint is + * ignored on those architectures. * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ -hipError_t hipCtxSetSharedMemConfig ( hipSharedMemConfig config ); +hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config); /** * @brief Get Shared memory bank configuration. @@ -1761,22 +1953,26 @@ hipError_t hipCtxSetSharedMemConfig ( hipSharedMemConfig config ); * * @return #hipSuccess * - * @warning AMD devices and some Nvidia GPUS do not support shared cache banking, and the hint is ignored on those architectures. + * @warning AMD devices and some Nvidia GPUS do not support shared cache banking, and the hint is + * ignored on those architectures. * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ -hipError_t hipCtxGetSharedMemConfig ( hipSharedMemConfig * pConfig ); +hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig* pConfig); /** * @brief Blocks until the default context has completed all preceding requested tasks. * * @return #hipSuccess * - * @warning This function waits for all streams on the default context to complete execution, and then returns. + * @warning This function waits for all streams on the default context to complete execution, and + * then returns. * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxGetDevice -*/ -hipError_t hipCtxSynchronize ( void ); + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxGetDevice + */ +hipError_t hipCtxSynchronize(void); /** * @brief Return flags used for creating default context. @@ -1785,41 +1981,49 @@ hipError_t hipCtxSynchronize ( void ); * * @returns #hipSuccess * - * @see hipCtxCreate, hipCtxDestroy, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice -*/ -hipError_t hipCtxGetFlags ( unsigned int* flags ); + * @see hipCtxCreate, hipCtxDestroy, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + */ +hipError_t hipCtxGetFlags(unsigned int* flags); /** * @brief Enables direct access to memory allocations in a peer context. * - * Memory which already allocated on peer device will be mapped into the address space of the current device. In addition, all - * future memory allocations on peerDeviceId will be mapped into the address space of the current device when the memory is allocated. - * The peer memory remains accessible from the current device until a call to hipDeviceDisablePeerAccess or hipDeviceReset. + * Memory which already allocated on peer device will be mapped into the address space of the + * current device. In addition, all future memory allocations on peerDeviceId will be mapped into + * the address space of the current device when the memory is allocated. The peer memory remains + * accessible from the current device until a call to hipDeviceDisablePeerAccess or hipDeviceReset. * * * @param [in] peerCtx * @param [in] flags * - * @returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue, #hipErrorPeerAccessAlreadyEnabled + * @returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue, + * #hipErrorPeerAccessAlreadyEnabled * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice * @warning PeerToPeer support is experimental. */ -hipError_t hipCtxEnablePeerAccess (hipCtx_t peerCtx, unsigned int flags); +hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags); /** - * @brief Disable direct access from current context's virtual address space to memory allocations physically located on a peer context.Disables direct access to memory allocations in a peer context and unregisters any registered allocations. + * @brief Disable direct access from current context's virtual address space to memory allocations + * physically located on a peer context.Disables direct access to memory allocations in a peer + * context and unregisters any registered allocations. * - * Returns hipErrorPeerAccessNotEnabled if direct access to memory on peerDevice has not yet been enabled from the current device. + * Returns hipErrorPeerAccessNotEnabled if direct access to memory on peerDevice has not yet been + * enabled from the current device. * * @param [in] peerCtx * * @returns #hipSuccess, #hipErrorPeerAccessNotEnabled * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice * @warning PeerToPeer support is experimental. */ -hipError_t hipCtxDisablePeerAccess (hipCtx_t peerCtx); +hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx); /** * @brief Get the state of the primary context. @@ -1830,9 +2034,10 @@ hipError_t hipCtxDisablePeerAccess (hipCtx_t peerCtx); * * @returns #hipSuccess * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ -hipError_t hipDevicePrimaryCtxGetState ( hipDevice_t dev, unsigned int* flags, int* active ); +hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, int* active); /** * @brief Release the primary context on the GPU. @@ -1841,10 +2046,12 @@ hipError_t hipDevicePrimaryCtxGetState ( hipDevice_t dev, unsigned int* flags, i * * @returns #hipSuccess * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice - * @warning This function return #hipSuccess though doesn't release the primaryCtx by design on HIP/HCC path. + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @warning This function return #hipSuccess though doesn't release the primaryCtx by design on + * HIP/HCC path. */ -hipError_t hipDevicePrimaryCtxRelease ( hipDevice_t dev); +hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev); /** * @brief Retain the primary context on the GPU. @@ -1854,9 +2061,10 @@ hipError_t hipDevicePrimaryCtxRelease ( hipDevice_t dev); * * @returns #hipSuccess * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ -hipError_t hipDevicePrimaryCtxRetain ( hipCtx_t* pctx, hipDevice_t dev ); +hipError_t hipDevicePrimaryCtxRetain(hipCtx_t* pctx, hipDevice_t dev); /** * @brief Resets the primary context on the GPU. @@ -1865,9 +2073,10 @@ hipError_t hipDevicePrimaryCtxRetain ( hipCtx_t* pctx, hipDevice_t dev ); * * @returns #hipSuccess * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ -hipError_t hipDevicePrimaryCtxReset ( hipDevice_t dev ); +hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev); /** * @brief Set flags for the primary context. @@ -1877,9 +2086,10 @@ hipError_t hipDevicePrimaryCtxReset ( hipDevice_t dev ); * * @returns #hipSuccess, #hipErrorContextAlreadyInUse * - * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice + * @see hipCtxCreate, hipCtxDestroy, hipCtxGetFlags, hipCtxPopCurrent, hipCtxGetCurrent, + * hipCtxSetCurrent, hipCtxPushCurrent, hipCtxSetCacheConfig, hipCtxSynchronize, hipCtxGetDevice */ -hipError_t hipDevicePrimaryCtxSetFlags ( hipDevice_t dev, unsigned int flags ); +hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags); // doxygen end Context Management /** @@ -1893,7 +2103,7 @@ hipError_t hipDevicePrimaryCtxSetFlags ( hipDevice_t dev, unsigned int flags ); * * @returns #hipSuccess, #hipErrorInavlidDevice */ -hipError_t hipDeviceGet(hipDevice_t *device, int ordinal); +hipError_t hipDeviceGet(hipDevice_t* device, int ordinal); /** * @brief Returns the compute capability of the device @@ -1903,7 +2113,7 @@ hipError_t hipDeviceGet(hipDevice_t *device, int ordinal); * * @returns #hipSuccess, #hipErrorInavlidDevice */ -hipError_t hipDeviceComputeCapability(int *major,int *minor,hipDevice_t device); +hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device); /** * @brief Returns an identifer string for the device. @@ -1913,7 +2123,7 @@ hipError_t hipDeviceComputeCapability(int *major,int *minor,hipDevice_t device); * * @returns #hipSuccess, #hipErrorInavlidDevice */ -hipError_t hipDeviceGetName(char *name,int len,hipDevice_t device); +hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device); /** * @brief Returns a PCI Bus Id string for the device, overloaded to take int device ID. @@ -1923,7 +2133,7 @@ hipError_t hipDeviceGetName(char *name,int len,hipDevice_t device); * * @returns #hipSuccess, #hipErrorInavlidDevice */ -hipError_t hipDeviceGetPCIBusId (char *pciBusId,int len,int device); +hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device); /** @@ -1933,7 +2143,7 @@ hipError_t hipDeviceGetPCIBusId (char *pciBusId,int len,int device); * * @returns #hipSuccess, #hipErrorInavlidDevice, #hipErrorInvalidValue */ -hipError_t hipDeviceGetByPCIBusId ( int* device,const char* pciBusId ); +hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId); /** @@ -1943,7 +2153,7 @@ hipError_t hipDeviceGetByPCIBusId ( int* device,const char* pciBusId ); * * @returns #hipSuccess, #hipErrorInavlidDevice */ -hipError_t hipDeviceTotalMem (size_t *bytes,hipDevice_t device); +hipError_t hipDeviceTotalMem(size_t* bytes, hipDevice_t device); /** * @brief Returns the approximate HIP driver version. @@ -1960,7 +2170,7 @@ hipError_t hipDeviceTotalMem (size_t *bytes,hipDevice_t device); * * @see hipRuntimeGetVersion */ -hipError_t hipDriverGetVersion(int *driverVersion) ; +hipError_t hipDriverGetVersion(int* driverVersion); /** * @brief Returns the approximate HIP Runtime version. @@ -1974,7 +2184,7 @@ hipError_t hipDriverGetVersion(int *driverVersion) ; * * @see hipDriverGetVersion */ -hipError_t hipRuntimeGetVersion(int *runtimeVersion) ; +hipError_t hipRuntimeGetVersion(int* runtimeVersion); /** * @brief Loads code object from file into a hipModule_t @@ -1982,11 +2192,12 @@ hipError_t hipRuntimeGetVersion(int *runtimeVersion) ; * @param [in] fname * @param [out] module * - * @returns hipSuccess, hipErrorInvalidValue, hipErrorInvalidContext, hipErrorFileNotFound, hipErrorOutOfMemory, hipErrorSharedObjectInitFailed, hipErrorNotInitialized + * @returns hipSuccess, hipErrorInvalidValue, hipErrorInvalidContext, hipErrorFileNotFound, + * hipErrorOutOfMemory, hipErrorSharedObjectInitFailed, hipErrorNotInitialized * * */ -hipError_t hipModuleLoad(hipModule_t *module, const char *fname); +hipError_t hipModuleLoad(hipModule_t* module, const char* fname); /** * @brief Frees the module @@ -2007,12 +2218,14 @@ hipError_t hipModuleUnload(hipModule_t module); * @param [in] kname * @param [out] function * - * @returns hipSuccess, hipErrorInvalidValue, hipErrorInvalidContext, hipErrorNotInitialized, hipErrorNotFound, + * @returns hipSuccess, hipErrorInvalidValue, hipErrorInvalidContext, hipErrorNotInitialized, + * hipErrorNotFound, */ -hipError_t hipModuleGetFunction(hipFunction_t *function, hipModule_t module, const char *kname); +hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, const char* kname); /** - * @brief returns device memory pointer and size of the kernel present in the module with symbol @p name + * @brief returns device memory pointer and size of the kernel present in the module with symbol @p + * name * * @param [out] dptr * @param [out] bytes @@ -2021,34 +2234,39 @@ hipError_t hipModuleGetFunction(hipFunction_t *function, hipModule_t module, con * * @returns hipSuccess, hipErrorInvalidValue, hipErrorNotInitialized */ -hipError_t hipModuleGetGlobal(hipDeviceptr_t *dptr, size_t *bytes, hipModule_t hmod, const char *name); +hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes, hipModule_t hmod, + const char* name); hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name); /** - * @brief builds module from code object which resides in host memory. Image is pointer to that location. + * @brief builds module from code object which resides in host memory. Image is pointer to that + * location. * * @param [in] image * @param [out] module * * @returns hipSuccess, hipErrorNotInitialized, hipErrorOutOfMemory, hipErrorNotInitialized */ -hipError_t hipModuleLoadData(hipModule_t *module, const void *image); +hipError_t hipModuleLoadData(hipModule_t* module, const void* image); /** -* @brief builds module from code object which resides in host memory. Image is pointer to that location. Options are not used. hipModuleLoadData is called. -* -* @param [in] image -* @param [out] module -* @param [in] number of options -* @param [in] options for JIT -* @param [in] option values for JIT -* -* @returns hipSuccess, hipErrorNotInitialized, hipErrorOutOfMemory, hipErrorNotInitialized -*/ -hipError_t hipModuleLoadDataEx(hipModule_t *module, const void *image, unsigned int numOptions, hipJitOption *options, void **optionValues); + * @brief builds module from code object which resides in host memory. Image is pointer to that + * location. Options are not used. hipModuleLoadData is called. + * + * @param [in] image + * @param [out] module + * @param [in] number of options + * @param [in] options for JIT + * @param [in] option values for JIT + * + * @returns hipSuccess, hipErrorNotInitialized, hipErrorOutOfMemory, hipErrorNotInitialized + */ +hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* image, unsigned int numOptions, + hipJitOption* options, void** optionValues); /** - * @brief launches kernel f with launch parameters and shared memory on stream with arguments passed to kernelparams or extra + * @brief launches kernel f with launch parameters and shared memory on stream with arguments passed + * to kernelparams or extra * * @param [in] f Kernel to launch. * @param [in] gridDimX X grid dimension specified as multiple of blockDimX. @@ -2057,26 +2275,24 @@ hipError_t hipModuleLoadDataEx(hipModule_t *module, const void *image, unsigned * @param [in] blockDimX X block dimensions specified in work-items * @param [in] blockDimY Y grid dimension specified in work-items * @param [in] blockDimZ Z grid dimension specified in work-items - * @param [in] sharedMemBytes Amount of dynamic shared memory to allocate for this kernel. The kernel can access this with HIP_DYNAMIC_SHARED. - * @param [in] stream Stream where the kernel should be dispatched. May be 0, in which case th default stream is used with associated synchronization rules. + * @param [in] sharedMemBytes Amount of dynamic shared memory to allocate for this kernel. The + * kernel can access this with HIP_DYNAMIC_SHARED. + * @param [in] stream Stream where the kernel should be dispatched. May be 0, in which case th + * default stream is used with associated synchronization rules. * @param [in] kernelParams - * @param [in] extra Pointer to kernel arguments. These are passed directly to the kernel and must be in the memory layout and alignment expected by the kernel. + * @param [in] extra Pointer to kernel arguments. These are passed directly to the kernel and + * must be in the memory layout and alignment expected by the kernel. * * @returns hipSuccess, hipInvalidDevice, hipErrorNotInitialized, hipErrorInvalidValue * - * @warning kernellParams argument is not yet implemented in HIP. Please use extra instead. Please refer to hip_porting_driver_api.md for sample usage. + * @warning kernellParams argument is not yet implemented in HIP. Please use extra instead. Please + * refer to hip_porting_driver_api.md for sample usage. */ -hipError_t hipModuleLaunchKernel(hipFunction_t f, - unsigned int gridDimX, - unsigned int gridDimY, - unsigned int gridDimZ, - unsigned int blockDimX, - unsigned int blockDimY, - unsigned int blockDimZ, - unsigned int sharedMemBytes, - hipStream_t stream, - void **kernelParams, - void **extra) ; +hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY, + unsigned int gridDimZ, unsigned int blockDimX, + unsigned int blockDimY, unsigned int blockDimZ, + unsigned int sharedMemBytes, hipStream_t stream, + void** kernelParams, void** extra); // doxygen end Version Management /** @@ -2117,7 +2333,7 @@ hipError_t hipProfilerStop(); * @} */ -//TODO: implement IPC apis +// TODO: implement IPC apis /** * @brief Gets an interprocess memory handle for an existing device memory @@ -2144,7 +2360,7 @@ hipError_t hipProfilerStop(); * hipErrorMapBufferObjectFailed, * */ -hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr); +hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr); /** * @brief Opens an interprocess memory handle exported from another process @@ -2182,8 +2398,7 @@ hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr); * In particular, multiple processes may not receive the same address for the same @p handle. * */ -hipError_t hipIpcOpenMemHandle(void **devPtr, - hipIpcMemHandle_t handle, unsigned int flags); +hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags); /** * @brief Close memory mapped with hipIpcOpenMemHandle @@ -2203,7 +2418,7 @@ hipError_t hipIpcOpenMemHandle(void **devPtr, * hipErrorInvalidResourceHandle, * */ -hipError_t hipIpcCloseMemHandle(void *devPtr); +hipError_t hipIpcCloseMemHandle(void* devPtr); // hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr); @@ -2218,25 +2433,20 @@ hipError_t hipIpcCloseMemHandle(void *devPtr); #ifdef __cplusplus -hipError_t hipBindTexture(size_t* offset, - textureReference* tex, - const void* devPtr, - const hipChannelFormatDesc* desc, - size_t size = UINT_MAX); +hipError_t hipBindTexture(size_t* offset, textureReference* tex, const void* devPtr, + const hipChannelFormatDesc* desc, size_t size = UINT_MAX); -hipError_t ihipBindTextureImpl(int dim, - enum hipTextureReadMode readMode, - size_t *offset, - const void *devPtr, - const struct hipChannelFormatDesc* desc, - size_t size, - textureReference* tex); +hipError_t ihipBindTextureImpl(int dim, enum hipTextureReadMode readMode, size_t* offset, + const void* devPtr, const struct hipChannelFormatDesc* desc, + size_t size, textureReference* tex); /* - * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture reference tex. + * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture + *reference tex. * - * @p desc describes how the memory is interpreted when fetching values from the texture. The @p offset parameter is an optional byte offset as with the low-level - * hipBindTexture() function. Any memory previously bound to tex is unbound. + * @p desc describes how the memory is interpreted when fetching values from the texture. The @p + *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any + *memory previously bound to tex is unbound. * * @param[in] offset - Offset in bytes * @param[out] tex - texture to bind @@ -2246,20 +2456,18 @@ hipError_t ihipBindTextureImpl(int dim, * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown **/ template -hipError_t hipBindTexture(size_t *offset, - struct texture& tex, - const void *devPtr, - const struct hipChannelFormatDesc& desc, - size_t size = UINT_MAX) -{ +hipError_t hipBindTexture(size_t* offset, struct texture& tex, const void* devPtr, + const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) { return ihipBindTextureImpl(dim, readMode, offset, devPtr, &desc, size, &tex); } /* - * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture reference tex. + * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture + *reference tex. * - * @p desc describes how the memory is interpreted when fetching values from the texture. The @p offset parameter is an optional byte offset as with the low-level - * hipBindTexture() function. Any memory previously bound to tex is unbound. + * @p desc describes how the memory is interpreted when fetching values from the texture. The @p + *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any + *memory previously bound to tex is unbound. * * @param[in] offset - Offset in bytes * @param[in] tex - texture to bind @@ -2268,98 +2476,69 @@ hipError_t hipBindTexture(size_t *offset, * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown **/ template -hipError_t hipBindTexture(size_t *offset, - struct texture& tex, - const void *devPtr, - size_t size = UINT_MAX) -{ +hipError_t hipBindTexture(size_t* offset, struct texture& tex, const void* devPtr, + size_t size = UINT_MAX) { return ihipBindTextureImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), size, &tex); } // C API -hipError_t hipBindTexture2D(size_t* offset, - textureReference* tex, - const void* devPtr, - const hipChannelFormatDesc* desc, - size_t width, - size_t height, +hipError_t hipBindTexture2D(size_t* offset, textureReference* tex, const void* devPtr, + const hipChannelFormatDesc* desc, size_t width, size_t height, size_t pitch); -hipError_t ihipBindTexture2DImpl(int dim, - enum hipTextureReadMode readMode, - size_t *offset, - const void *devPtr, - const struct hipChannelFormatDesc* desc, - size_t width, - size_t height, - textureReference* tex); +hipError_t ihipBindTexture2DImpl(int dim, enum hipTextureReadMode readMode, size_t* offset, + const void* devPtr, const struct hipChannelFormatDesc* desc, + size_t width, size_t height, textureReference* tex); template -hipError_t hipBindTexture2D(size_t *offset, - struct texture& tex, - const void *devPtr, - size_t width, - size_t height, - size_t pitch) -{ - return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height, &tex); +hipError_t hipBindTexture2D(size_t* offset, struct texture& tex, + const void* devPtr, size_t width, size_t height, size_t pitch) { + return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height, + &tex); } template -hipError_t hipBindTexture2D(size_t *offset, - struct texture& tex, - const void *devPtr, - const struct hipChannelFormatDesc &desc, - size_t width, - size_t height, - size_t pitch) -{ +hipError_t hipBindTexture2D(size_t* offset, struct texture& tex, + const void* devPtr, const struct hipChannelFormatDesc& desc, + size_t width, size_t height, size_t pitch) { return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &desc, width, height, &tex); } -//C API -hipError_t hipBindTextureToArray(textureReference* tex, - hipArray_const_t array, +// C API +hipError_t hipBindTextureToArray(textureReference* tex, hipArray_const_t array, const hipChannelFormatDesc* desc); -hipError_t ihipBindTextureToArrayImpl(int dim, - enum hipTextureReadMode readMode, +hipError_t ihipBindTextureToArrayImpl(int dim, enum hipTextureReadMode readMode, hipArray_const_t array, const struct hipChannelFormatDesc& desc, textureReference* tex); template -hipError_t hipBindTextureToArray(struct texture& tex, - hipArray_const_t array) -{ +hipError_t hipBindTextureToArray(struct texture& tex, hipArray_const_t array) { return ihipBindTextureToArrayImpl(dim, readMode, array, tex.channelDesc, &tex); } template -hipError_t hipBindTextureToArray(struct texture& tex, - hipArray_const_t array, - const struct hipChannelFormatDesc& desc) -{ +hipError_t hipBindTextureToArray(struct texture& tex, hipArray_const_t array, + const struct hipChannelFormatDesc& desc) { return ihipBindTextureToArrayImpl(dim, readMode, array, desc, &tex); } -//C API +// C API hipError_t hipBindTextureToMipmappedArray(const textureReference* tex, hipMipmappedArray_const_t mipmappedArray, const hipChannelFormatDesc* desc); template hipError_t hipBindTextureToMipmappedArray(const texture& tex, - hipMipmappedArray_const_t mipmappedArray) -{ + hipMipmappedArray_const_t mipmappedArray) { return hipSuccess; } template hipError_t hipBindTextureToMipmappedArray(const texture& tex, hipMipmappedArray_const_t mipmappedArray, - const hipChannelFormatDesc& desc) -{ + const hipChannelFormatDesc& desc) { return hipSuccess; } @@ -2375,38 +2554,41 @@ hipError_t hipUnbindTexture(const textureReference* tex); extern hipError_t ihipUnbindTextureImpl(const hipTextureObject_t& textureObject); template -hipError_t hipUnbindTexture(struct texture &tex) -{ +hipError_t hipUnbindTexture(struct texture& tex) { return ihipUnbindTextureImpl(tex.textureObject); } hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, hipArray_const_t array); -hipError_t hipGetTextureAlignmentOffset (size_t* offset, const textureReference* texref); +hipError_t hipGetTextureAlignmentOffset(size_t* offset, const textureReference* texref); hipError_t hipGetTextureReference(const textureReference** texref, const void* symbol); -hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, - const hipResourceDesc* pResDesc, +hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResourceDesc* pResDesc, const hipTextureDesc* pTexDesc, const hipResourceViewDesc* pResViewDesc); hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject); -hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDesc, hipTextureObject_t textureObject); -hipError_t hipGetTextureObjectResourceViewDesc(hipResourceViewDesc* pResViewDesc, hipTextureObject_t textureObject); -hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc* pTexDesc, hipTextureObject_t textureObject); -hipError_t hipTexRefSetArray ( textureReference* tex, hipArray_const_t array, unsigned int flags ); +hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDesc, + hipTextureObject_t textureObject); +hipError_t hipGetTextureObjectResourceViewDesc(hipResourceViewDesc* pResViewDesc, + hipTextureObject_t textureObject); +hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc* pTexDesc, + hipTextureObject_t textureObject); +hipError_t hipTexRefSetArray(textureReference* tex, hipArray_const_t array, unsigned int flags); -hipError_t hipTexRefSetAddressMode ( textureReference* tex, int dim, hipTextureAddressMode am ); +hipError_t hipTexRefSetAddressMode(textureReference* tex, int dim, hipTextureAddressMode am); -hipError_t hipTexRefSetFilterMode ( textureReference* tex, hipTextureFilterMode fm ); +hipError_t hipTexRefSetFilterMode(textureReference* tex, hipTextureFilterMode fm); -hipError_t hipTexRefSetFlags ( textureReference* tex, unsigned int flags ); +hipError_t hipTexRefSetFlags(textureReference* tex, unsigned int flags); -hipError_t hipTexRefSetFormat (textureReference* tex, hipArray_Format fmt, int NumPackedComponents ); +hipError_t hipTexRefSetFormat(textureReference* tex, hipArray_Format fmt, int NumPackedComponents); -hipError_t hipTexRefSetAddress( size_t* offset, textureReference* tex, hipDeviceptr_t devPtr, size_t size ); +hipError_t hipTexRefSetAddress(size_t* offset, textureReference* tex, hipDeviceptr_t devPtr, + size_t size); -hipError_t hipTexRefSetAddress2D( textureReference* tex, const HIP_ARRAY_DESCRIPTOR* desc, hipDeviceptr_t devPtr, size_t pitch ); +hipError_t hipTexRefSetAddress2D(textureReference* tex, const HIP_ARRAY_DESCRIPTOR* desc, + hipDeviceptr_t devPtr, size_t pitch); hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, const hipResourceDesc* pResDesc); @@ -2444,7 +2626,6 @@ hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject); */ - // doxygen end HIP API /** * @} diff --git a/hipamd/include/hip/hcc_detail/hip_surface_types.h b/hipamd/include/hip/hcc_detail/hip_surface_types.h index c1bea64f97..f74c01d700 100644 --- a/hipamd/include/hip/hcc_detail/hip_surface_types.h +++ b/hipamd/include/hip/hcc_detail/hip_surface_types.h @@ -28,7 +28,7 @@ THE SOFTWARE. #ifndef HIP_INCLUDE_HIP_HCC_DETAIL_HIP_SURFACE_TYPES_H #define HIP_INCLUDE_HIP_HCC_DETAIL_HIP_SURFACE_TYPES_H -#include +#include /** * An opaque value that represents a hip surface object @@ -38,21 +38,17 @@ typedef unsigned long long hipSurfaceObject_t; /** * hip surface reference */ -struct surfaceReference -{ - hipSurfaceObject_t surfaceObject; +struct surfaceReference { + hipSurfaceObject_t surfaceObject; }; /** * hip surface boundary modes */ -enum hipSurfaceBoundaryMode -{ - hipBoundaryModeZero = 0, - hipBoundaryModeTrap = 1, - hipBoundaryModeClamp = 2 +enum hipSurfaceBoundaryMode { + hipBoundaryModeZero = 0, + hipBoundaryModeTrap = 1, + hipBoundaryModeClamp = 2 }; #endif /* !HIP_INCLUDE_HIP_HCC_DETAIL_HIP_SURFACE_TYPES_H */ - - diff --git a/hipamd/include/hip/hcc_detail/hip_texture_types.h b/hipamd/include/hip/hcc_detail/hip_texture_types.h index 27f8747653..0a68b507e8 100644 --- a/hipamd/include/hip/hcc_detail/hip_texture_types.h +++ b/hipamd/include/hip/hcc_detail/hip_texture_types.h @@ -29,10 +29,10 @@ THE SOFTWARE. #define HIP_INCLUDE_HIP_HCC_DETAIL_HIP_TEXTURE_TYPES_H /******************************************************************************* -* * -* * -* * -*******************************************************************************/ + * * + * * + * * + *******************************************************************************/ #include //#include #include @@ -41,43 +41,37 @@ THE SOFTWARE. #if __cplusplus /******************************************************************************* -* * -* * -* * -*******************************************************************************/ + * * + * * + * * + *******************************************************************************/ -template -struct texture : public textureReference -{ - texture(int norm = 0, - enum hipTextureFilterMode fMode = hipFilterModePoint, - enum hipTextureAddressMode aMode = hipAddressModeClamp) - { - normalized = norm; - filterMode = fMode; +template +struct texture : public textureReference { + texture(int norm = 0, enum hipTextureFilterMode fMode = hipFilterModePoint, + enum hipTextureAddressMode aMode = hipAddressModeClamp) { + normalized = norm; + filterMode = fMode; addressMode[0] = aMode; addressMode[1] = aMode; addressMode[2] = aMode; - channelDesc = hipCreateChannelDesc(); - sRGB = 0; + channelDesc = hipCreateChannelDesc(); + sRGB = 0; } - texture(int norm, - enum hipTextureFilterMode fMode, - enum hipTextureAddressMode aMode, - struct hipChannelFormatDesc desc) - { - normalized = norm; - filterMode = fMode; + texture(int norm, enum hipTextureFilterMode fMode, enum hipTextureAddressMode aMode, + struct hipChannelFormatDesc desc) { + normalized = norm; + filterMode = fMode; addressMode[0] = aMode; addressMode[1] = aMode; addressMode[2] = aMode; - channelDesc = desc; - sRGB = 0; + channelDesc = desc; + sRGB = 0; } }; #endif /* __cplusplus */ #endif /* !HIP_INCLUDE_HIP_HCC_DETAIL_HIP_TEXTURE_TYPES_H */ - diff --git a/hipamd/include/hip/hcc_detail/hip_vector_types.h b/hipamd/include/hip/hcc_detail/hip_vector_types.h index 93c82cc0cb..7cd250e257 100644 --- a/hipamd/include/hip/hcc_detail/hip_vector_types.h +++ b/hipamd/include/hip/hcc_detail/hip_vector_types.h @@ -28,50 +28,51 @@ THE SOFTWARE. #ifndef HIP_INCLUDE_HIP_HCC_DETAIL_HIP_VECTOR_TYPES_H #define HIP_INCLUDE_HIP_HCC_DETAIL_HIP_VECTOR_TYPES_H -#if defined (__HCC__) && (__hcc_workweek__ < 16032) +#if defined(__HCC__) && (__hcc_workweek__ < 16032) #error("This version of HIP requires a newer version of HCC."); #endif #include "hip/hcc_detail/host_defines.h" -#define MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(type) \ -__device__ __host__ type() {} \ -__device__ __host__ type(const type& val) : x(val.x) { } \ -__device__ __host__ ~type() {} +#define MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(type) \ + __device__ __host__ type() {} \ + __device__ __host__ type(const type& val) : x(val.x) {} \ + __device__ __host__ ~type() {} -#define MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(type) \ -__device__ __host__ type() {} \ -__device__ __host__ type(const type& val) : x(val.x), y(val.y) { } \ -__device__ __host__ ~type() {} +#define MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(type) \ + __device__ __host__ type() {} \ + __device__ __host__ type(const type& val) : x(val.x), y(val.y) {} \ + __device__ __host__ ~type() {} -#define MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(type) \ -__device__ __host__ type() {} \ -__device__ __host__ type(const type& val) : x(val.x), y(val.y), z(val.z) { } \ -__device__ __host__ ~type() {} +#define MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(type) \ + __device__ __host__ type() {} \ + __device__ __host__ type(const type& val) : x(val.x), y(val.y), z(val.z) {} \ + __device__ __host__ ~type() {} -#define MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(type) \ -__device__ __host__ type() {} \ -__device__ __host__ type(const type& val) : x(val.x), y(val.y), z(val.z), w(val.w) { } \ -__device__ __host__ ~type() {} +#define MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(type) \ + __device__ __host__ type() {} \ + __device__ __host__ type(const type& val) : x(val.x), y(val.y), z(val.z), w(val.w) {} \ + __device__ __host__ ~type() {} -#define MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(type, type1) \ -__device__ __host__ type(type1 val) : x(val) {} \ +#define MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(type, type1) \ + __device__ __host__ type(type1 val) : x(val) {} -#define MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(type, type1) \ -__device__ __host__ type(type1 val) : x(val), y(val) {} \ -__device__ __host__ type(type1 val1, type1 val2) : x(val1), y(val2) {} \ +#define MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(type, type1) \ + __device__ __host__ type(type1 val) : x(val), y(val) {} \ + __device__ __host__ type(type1 val1, type1 val2) : x(val1), y(val2) {} -#define MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(type, type1) \ -__device__ __host__ type(type1 val) : x(val), y(val), z(val) {} \ -__device__ __host__ type(type1 val1, type1 val2, type1 val3) : x(val1), y(val2), z(val3) {} \ +#define MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(type, type1) \ + __device__ __host__ type(type1 val) : x(val), y(val), z(val) {} \ + __device__ __host__ type(type1 val1, type1 val2, type1 val3) : x(val1), y(val2), z(val3) {} -#define MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(type, type1) \ -__device__ __host__ type(type1 val) : x(val), y(val), z(val), w(val) {} \ -__device__ __host__ type(type1 val1, type1 val2, type1 val3, type1 val4) : x(val1), y(val2), z(val3), w(val4) {} \ +#define MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(type, type1) \ + __device__ __host__ type(type1 val) : x(val), y(val), z(val), w(val) {} \ + __device__ __host__ type(type1 val1, type1 val2, type1 val3, type1 val4) \ + : x(val1), y(val2), z(val3), w(val4) {} struct uchar1 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(uchar1) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, unsigned char) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, signed char) @@ -86,14 +87,14 @@ struct uchar1 { MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uchar1, signed long long) - #endif - unsigned char x; +#endif + unsigned char x; } __attribute__((aligned(1))); struct uchar2 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(uchar2) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, unsigned char) @@ -108,18 +109,18 @@ struct uchar2 { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uchar2, signed long long) - #endif - union { - struct { - unsigned char x, y; +#endif + union { + struct { + unsigned char x, y; + }; + unsigned short a; }; - unsigned short a; - }; } __attribute__((aligned(2))); struct uchar3 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(uchar3) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, unsigned char) @@ -134,13 +135,13 @@ struct uchar3 { MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, signed long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uchar3, signed long long) - #endif - unsigned char x, y, z; +#endif + unsigned char x, y, z; }; struct uchar4 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(uchar4) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, unsigned char) @@ -155,19 +156,19 @@ struct uchar4 { MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, signed long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uchar4, signed long long) - #endif - union { - struct { - unsigned char x, y, z, w; +#endif + union { + struct { + unsigned char x, y, z, w; + }; + unsigned int a; }; - unsigned int a; - }; } __attribute__((aligned(4))); struct char1 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(char1) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, unsigned char) @@ -182,13 +183,13 @@ struct char1 { MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, signed long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(char1, signed long long) - #endif - signed char x; +#endif + signed char x; } __attribute__((aligned(1))); struct char2 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(char2) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, unsigned char) @@ -203,18 +204,18 @@ struct char2 { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(char2, signed long long) - #endif - union { - struct { - signed char x, y; +#endif + union { + struct { + signed char x, y; + }; + unsigned short a; }; - unsigned short a; - }; } __attribute__((aligned(2))); struct char3 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(char3) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, unsigned char) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, signed char) @@ -228,13 +229,13 @@ struct char3 { MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, signed long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(char3, signed long long) - #endif - signed char x, y, z; +#endif + signed char x, y, z; }; struct char4 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(char4) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, unsigned char) @@ -249,20 +250,19 @@ struct char4 { MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, signed long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(char4, signed long long) - #endif - union { - struct { - signed char x, y, z, w; +#endif + union { + struct { + signed char x, y, z, w; + }; + unsigned int a; }; - unsigned int a; - }; } __attribute__((aligned(4))); - struct ushort1 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(ushort1) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, unsigned char) @@ -277,13 +277,13 @@ struct ushort1 { MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, signed long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ushort1, signed long long) - #endif - unsigned short x; +#endif + unsigned short x; } __attribute__((aligned(2))); struct ushort2 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(ushort2) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, unsigned char) @@ -298,18 +298,18 @@ struct ushort2 { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ushort2, signed long long) - #endif - union { - struct { - unsigned short x, y; +#endif + union { + struct { + unsigned short x, y; + }; + unsigned int a; }; - unsigned int a; - }; } __attribute__((aligned(4))); struct ushort3 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(ushort3) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, unsigned char) @@ -324,13 +324,13 @@ struct ushort3 { MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, signed long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ushort3, signed long long) - #endif - unsigned short x, y, z; +#endif + unsigned short x, y, z; }; struct ushort4 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(ushort4) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, unsigned char) @@ -345,18 +345,18 @@ struct ushort4 { MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, signed long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ushort4, signed long long) - #endif - union { - struct { - unsigned short x, y, z, w; +#endif + union { + struct { + unsigned short x, y, z, w; + }; + unsigned int a, b; }; - unsigned int a, b; - }; } __attribute__((aligned(8))); struct short1 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(short1) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, unsigned char) @@ -371,13 +371,13 @@ struct short1 { MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, signed long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(short1, signed long long) - #endif - signed short x; +#endif + signed short x; } __attribute__((aligned(2))); struct short2 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(short2) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, unsigned char) @@ -392,19 +392,19 @@ struct short2 { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(short2, signed long long) - #endif - union { - struct { - signed short x, y; +#endif + union { + struct { + signed short x, y; + }; + unsigned int a; }; - unsigned int a; - }; } __attribute__((aligned(4))); struct short3 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(short3) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, unsigned char) @@ -419,13 +419,13 @@ struct short3 { MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, signed long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(short3, signed long long) - #endif - signed short x, y, z; +#endif + signed short x, y, z; }; struct short4 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(short4) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, unsigned char) @@ -440,19 +440,19 @@ struct short4 { MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, signed long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(short4, signed long long) - #endif - union { - struct { - signed short x, y, z, w; +#endif + union { + struct { + signed short x, y, z, w; + }; + unsigned int a, b; }; - unsigned int a, b; - }; } __attribute__((aligned(8))); struct uint1 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(uint1) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, unsigned char) @@ -467,13 +467,13 @@ struct uint1 { MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, signed long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(uint1, signed long long) - #endif - unsigned int x; +#endif + unsigned int x; } __attribute__((aligned(4))); struct uint2 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(uint2) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, unsigned char) @@ -488,13 +488,13 @@ struct uint2 { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(uint2, signed long long) - #endif - unsigned int x, y; +#endif + unsigned int x, y; } __attribute__((aligned(8))); struct uint3 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(uint3) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, unsigned char) @@ -509,13 +509,13 @@ struct uint3 { MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, signed long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(uint3, signed long long) - #endif - unsigned int x, y, z; +#endif + unsigned int x, y, z; }; struct uint4 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(uint4) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, unsigned char) @@ -530,13 +530,13 @@ struct uint4 { MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, signed long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(uint4, signed long long) - #endif - unsigned int x, y, z, w; +#endif + unsigned int x, y, z, w; } __attribute__((aligned(16))); struct int1 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(int1) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, unsigned char) @@ -551,13 +551,13 @@ struct int1 { MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, signed long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(int1, signed long long) - #endif - signed int x; +#endif + signed int x; } __attribute__((aligned(4))); struct int2 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(int2) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, unsigned char) @@ -572,13 +572,13 @@ struct int2 { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(int2, signed long long) - #endif - signed int x, y; +#endif + signed int x, y; } __attribute__((aligned(8))); struct int3 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(int3) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, unsigned char) @@ -593,13 +593,13 @@ struct int3 { MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, signed long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(int3, signed long long) - #endif - signed int x, y, z; +#endif + signed int x, y, z; }; struct int4 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(int4) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, unsigned char) @@ -614,14 +614,14 @@ struct int4 { MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, signed long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(int4, signed long long) - #endif - signed int x, y, z, w; +#endif + signed int x, y, z, w; } __attribute__((aligned(16))); struct float1 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(float1) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, unsigned char) @@ -636,13 +636,13 @@ struct float1 { MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, signed long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(float1, signed long long) - #endif - float x; +#endif + float x; } __attribute__((aligned(4))); struct float2 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(float2) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, unsigned char) @@ -657,13 +657,13 @@ struct float2 { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(float2, signed long long) - #endif - float x, y; +#endif + float x, y; } __attribute__((aligned(8))); struct float3 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(float3) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, unsigned char) @@ -678,13 +678,13 @@ struct float3 { MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, signed long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(float3, signed long long) - #endif - float x, y, z; +#endif + float x, y, z; }; struct float4 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(float4) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, unsigned char) @@ -699,15 +699,14 @@ struct float4 { MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, signed long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(float4, signed long long) - #endif - float x, y, z, w; +#endif + float x, y, z, w; } __attribute__((aligned(16))); - struct double1 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(double1) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, unsigned char) @@ -722,13 +721,13 @@ struct double1 { MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, signed long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(double1, signed long long) - #endif - double x; +#endif + double x; } __attribute__((aligned(8))); struct double2 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(double2) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, unsigned char) @@ -743,13 +742,13 @@ struct double2 { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(double2, signed long long) - #endif - double x, y; +#endif + double x, y; } __attribute__((aligned(16))); struct double3 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(double3) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, unsigned char) @@ -764,13 +763,13 @@ struct double3 { MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, signed long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(double3, signed long long) - #endif - double x, y, z; +#endif + double x, y, z; }; struct double4 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(double4) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, unsigned char) @@ -785,14 +784,14 @@ struct double4 { MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, signed long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(double4, signed long long) - #endif - double x, y, z, w; +#endif + double x, y, z, w; } __attribute__((aligned(32))); struct ulong1 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(ulong1) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, unsigned char) @@ -807,13 +806,13 @@ struct ulong1 { MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, signed long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulong1, signed long long) - #endif - unsigned long x; +#endif + unsigned long x; } __attribute__((aligned(8))); struct ulong2 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(ulong2) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, unsigned char) @@ -828,13 +827,13 @@ struct ulong2 { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulong2, signed long long) - #endif - unsigned long x, y; +#endif + unsigned long x, y; } __attribute__((aligned(16))); struct ulong3 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(ulong3) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, unsigned char) @@ -849,13 +848,13 @@ struct ulong3 { MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, signed long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulong3, signed long long) - #endif - unsigned long x, y, z; +#endif + unsigned long x, y, z; }; struct ulong4 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(ulong4) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, unsigned char) @@ -870,14 +869,14 @@ struct ulong4 { MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, signed long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulong4, signed long long) - #endif - unsigned long x, y, z, w; +#endif + unsigned long x, y, z, w; } __attribute__((aligned(32))); struct long1 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(long1) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, unsigned char) @@ -892,13 +891,13 @@ struct long1 { MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, signed long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(long1, signed long long) - #endif - signed long x; +#endif + signed long x; } __attribute__((aligned(8))); struct long2 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(long2) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, unsigned char) @@ -913,13 +912,13 @@ struct long2 { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(long2, signed long long) - #endif - signed long x, y; +#endif + signed long x, y; } __attribute__((aligned(16))); struct long3 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(long3) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, unsigned char) @@ -934,13 +933,13 @@ struct long3 { MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, signed long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(long3, signed long long) - #endif - signed long x, y, z; +#endif + signed long x, y, z; }; struct long4 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(long4) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, unsigned char) @@ -955,14 +954,14 @@ struct long4 { MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, signed long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(long4, signed long long) - #endif - signed long x, y, z, w; +#endif + signed long x, y, z, w; } __attribute__((aligned(32))); struct ulonglong1 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, unsigned char) @@ -977,13 +976,13 @@ struct ulonglong1 { MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, signed long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(ulonglong1, signed long long) - #endif - unsigned long long x; +#endif + unsigned long long x; } __attribute__((aligned(8))); struct ulonglong2 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, unsigned char) @@ -998,13 +997,13 @@ struct ulonglong2 { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(ulonglong2, signed long long) - #endif - unsigned long long x, y; +#endif + unsigned long long x, y; } __attribute__((aligned(16))); struct ulonglong3 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, unsigned char) @@ -1019,13 +1018,13 @@ struct ulonglong3 { MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, signed long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(ulonglong3, signed long long) - #endif - unsigned long long x, y, z; +#endif + unsigned long long x, y, z; }; struct ulonglong4 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, unsigned char) @@ -1040,14 +1039,14 @@ struct ulonglong4 { MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, signed long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(ulonglong4, signed long long) - #endif - unsigned long long x, y, z, w; +#endif + unsigned long long x, y, z, w; } __attribute__((aligned(32))); struct longlong1 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(longlong1) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, unsigned char) @@ -1062,13 +1061,13 @@ struct longlong1 { MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, signed long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(longlong1, signed long long) - #endif - signed long long x; +#endif + signed long long x; } __attribute__((aligned(8))); struct longlong2 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(longlong2) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, unsigned char) @@ -1083,13 +1082,13 @@ struct longlong2 { MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, signed long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(longlong2, signed long long) - #endif - signed long long x, y; +#endif + signed long long x, y; } __attribute__((aligned(16))); struct longlong3 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(longlong3) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, unsigned char) @@ -1104,13 +1103,13 @@ struct longlong3 { MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, signed long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(longlong3, signed long long) - #endif - signed long long x, y, z; +#endif + signed long long x, y, z; }; struct longlong4 { - #ifdef __cplusplus - public: +#ifdef __cplusplus + public: MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(longlong4) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, unsigned char) @@ -1125,43 +1124,43 @@ struct longlong4 { MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, signed long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, unsigned long long) MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(longlong4, signed long long) - #endif - signed long x, y, z, w; +#endif + signed long x, y, z, w; } __attribute__((aligned(32))); -#define DECLOP_MAKE_ONE_COMPONENT(comp, type) \ -__device__ __host__ static inline struct type make_##type(comp x) { \ - struct type ret; \ - ret.x = x; \ - return ret; \ -} +#define DECLOP_MAKE_ONE_COMPONENT(comp, type) \ + __device__ __host__ static inline struct type make_##type(comp x) { \ + struct type ret; \ + ret.x = x; \ + return ret; \ + } -#define DECLOP_MAKE_TWO_COMPONENT(comp, type) \ -__device__ __host__ static inline struct type make_##type(comp x, comp y) { \ - struct type ret; \ - ret.x = x; \ - ret.y = y; \ - return ret; \ -} +#define DECLOP_MAKE_TWO_COMPONENT(comp, type) \ + __device__ __host__ static inline struct type make_##type(comp x, comp y) { \ + struct type ret; \ + ret.x = x; \ + ret.y = y; \ + return ret; \ + } -#define DECLOP_MAKE_THREE_COMPONENT(comp, type) \ -__device__ __host__ static inline struct type make_##type(comp x, comp y, comp z) { \ - struct type ret; \ - ret.x = x; \ - ret.y = y; \ - ret.z = z; \ - return ret; \ -} +#define DECLOP_MAKE_THREE_COMPONENT(comp, type) \ + __device__ __host__ static inline struct type make_##type(comp x, comp y, comp z) { \ + struct type ret; \ + ret.x = x; \ + ret.y = y; \ + ret.z = z; \ + return ret; \ + } -#define DECLOP_MAKE_FOUR_COMPONENT(comp, type) \ -__device__ __host__ static inline struct type make_##type(comp x, comp y, comp z, comp w) { \ - struct type ret; \ - ret.x = x; \ - ret.y = y; \ - ret.z = z; \ - ret.w = w; \ - return ret; \ -} +#define DECLOP_MAKE_FOUR_COMPONENT(comp, type) \ + __device__ __host__ static inline struct type make_##type(comp x, comp y, comp z, comp w) { \ + struct type ret; \ + ret.x = x; \ + ret.y = y; \ + ret.z = z; \ + ret.w = w; \ + return ret; \ + } DECLOP_MAKE_ONE_COMPONENT(unsigned char, uchar1); DECLOP_MAKE_TWO_COMPONENT(unsigned char, uchar2); @@ -1226,331 +1225,329 @@ DECLOP_MAKE_FOUR_COMPONENT(signed long, longlong4); #if __cplusplus -#define DECLOP_1VAR_2IN_1OUT(type, op) \ -__device__ __host__ static inline type operator op (const type& lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs.x op rhs.x; \ - return ret; \ -} +#define DECLOP_1VAR_2IN_1OUT(type, op) \ + __device__ __host__ static inline type operator op(const type& lhs, const type& rhs) { \ + type ret; \ + ret.x = lhs.x op rhs.x; \ + return ret; \ + } -#define DECLOP_1VAR_SCALE_PRODUCT(type, type1) \ -__device__ __host__ static inline type operator * (const type& lhs, type1 rhs) { \ - type ret; \ - ret.x = lhs.x * rhs; \ - return ret; \ -} \ -\ -__device__ __host__ static inline type operator * (type1 lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs * rhs.x; \ - return ret; \ -} +#define DECLOP_1VAR_SCALE_PRODUCT(type, type1) \ + __device__ __host__ static inline type operator*(const type& lhs, type1 rhs) { \ + type ret; \ + ret.x = lhs.x * rhs; \ + return ret; \ + } \ + \ + __device__ __host__ static inline type operator*(type1 lhs, const type& rhs) { \ + type ret; \ + ret.x = lhs * rhs.x; \ + return ret; \ + } -#define DECLOP_1VAR_ASSIGN(type, op) \ -__device__ __host__ static inline type& operator op ( type& lhs, const type& rhs) { \ - lhs.x op rhs.x; \ - return lhs; \ -} +#define DECLOP_1VAR_ASSIGN(type, op) \ + __device__ __host__ static inline type& operator op(type& lhs, const type& rhs) { \ + lhs.x op rhs.x; \ + return lhs; \ + } -#define DECLOP_1VAR_PREOP(type, op) \ -__device__ __host__ static inline type& operator op (type& val) { \ - op val.x; \ - return val; \ -} +#define DECLOP_1VAR_PREOP(type, op) \ + __device__ __host__ static inline type& operator op(type& val) { \ + op val.x; \ + return val; \ + } -#define DECLOP_1VAR_POSTOP(type, op) \ -__device__ __host__ static inline type operator op (type& val, int) { \ - type ret; \ - ret.x = val.x; \ - val.x op; \ - return ret; \ -} +#define DECLOP_1VAR_POSTOP(type, op) \ + __device__ __host__ static inline type operator op(type& val, int) { \ + type ret; \ + ret.x = val.x; \ + val.x op; \ + return ret; \ + } -#define DECLOP_1VAR_COMP(type, op) \ -__device__ __host__ static inline bool operator op (type& lhs, type& rhs) { \ - return lhs.x op rhs.x; \ -} \ -__device__ __host__ static inline bool operator op (const type& lhs, type& rhs) { \ - return lhs.x op rhs.x; \ -} \ -__device__ __host__ static inline bool operator op (type& lhs, const type& rhs) { \ - return lhs.x op rhs.x ; \ -} \ -__device__ __host__ static inline bool operator op (const type& lhs, const type& rhs) { \ - return lhs.x op rhs.x ; \ -} +#define DECLOP_1VAR_COMP(type, op) \ + __device__ __host__ static inline bool operator op(type& lhs, type& rhs) { \ + return lhs.x op rhs.x; \ + } \ + __device__ __host__ static inline bool operator op(const type& lhs, type& rhs) { \ + return lhs.x op rhs.x; \ + } \ + __device__ __host__ static inline bool operator op(type& lhs, const type& rhs) { \ + return lhs.x op rhs.x; \ + } \ + __device__ __host__ static inline bool operator op(const type& lhs, const type& rhs) { \ + return lhs.x op rhs.x; \ + } -#define DECLOP_1VAR_1IN_1OUT(type, op) \ -__device__ __host__ static inline type operator op(type& rhs) { \ - type ret; \ - ret.x = op rhs.x; \ - return ret; \ -} +#define DECLOP_1VAR_1IN_1OUT(type, op) \ + __device__ __host__ static inline type operator op(type& rhs) { \ + type ret; \ + ret.x = op rhs.x; \ + return ret; \ + } -#define DECLOP_1VAR_1IN_BOOLOUT(type, op) \ -__device__ __host__ static inline bool operator op (type& rhs) { \ - return op rhs.x; \ -} +#define DECLOP_1VAR_1IN_BOOLOUT(type, op) \ + __device__ __host__ static inline bool operator op(type& rhs) { return op rhs.x; } /* Two Element Access */ -#define DECLOP_2VAR_2IN_1OUT(type, op) \ -__device__ __host__ static inline type operator op (const type& lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs.x op rhs.x; \ - ret.y = lhs.y op rhs.y; \ - return ret; \ -} +#define DECLOP_2VAR_2IN_1OUT(type, op) \ + __device__ __host__ static inline type operator op(const type& lhs, const type& rhs) { \ + type ret; \ + ret.x = lhs.x op rhs.x; \ + ret.y = lhs.y op rhs.y; \ + return ret; \ + } -#define DECLOP_2VAR_SCALE_PRODUCT(type, type1) \ -__device__ __host__ static inline type operator * (const type& lhs, type1 rhs) { \ - type ret; \ - ret.x = lhs.x * rhs; \ - ret.y = lhs.y * rhs; \ - return ret; \ -} \ -\ -__device__ __host__ static inline type operator * (type1 lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs * rhs.x; \ - ret.y = lhs * rhs.y; \ - return ret; \ -} +#define DECLOP_2VAR_SCALE_PRODUCT(type, type1) \ + __device__ __host__ static inline type operator*(const type& lhs, type1 rhs) { \ + type ret; \ + ret.x = lhs.x * rhs; \ + ret.y = lhs.y * rhs; \ + return ret; \ + } \ + \ + __device__ __host__ static inline type operator*(type1 lhs, const type& rhs) { \ + type ret; \ + ret.x = lhs * rhs.x; \ + ret.y = lhs * rhs.y; \ + return ret; \ + } -#define DECLOP_2VAR_ASSIGN(type, op) \ -__device__ __host__ static inline type& operator op ( type& lhs, const type& rhs) { \ - lhs.x op rhs.x; \ - lhs.y op rhs.y; \ - return lhs; \ -} +#define DECLOP_2VAR_ASSIGN(type, op) \ + __device__ __host__ static inline type& operator op(type& lhs, const type& rhs) { \ + lhs.x op rhs.x; \ + lhs.y op rhs.y; \ + return lhs; \ + } -#define DECLOP_2VAR_PREOP(type, op) \ -__device__ __host__ static inline type& operator op (type& val) { \ - op val.x; \ - op val.y; \ - return val; \ -} +#define DECLOP_2VAR_PREOP(type, op) \ + __device__ __host__ static inline type& operator op(type& val) { \ + op val.x; \ + op val.y; \ + return val; \ + } -#define DECLOP_2VAR_POSTOP(type, op) \ -__device__ __host__ static inline type operator op (type& val, int) { \ - type ret; \ - ret.x = val.x; \ - ret.y = val.y; \ - val.x op; \ - val.y op; \ - return ret; \ -} +#define DECLOP_2VAR_POSTOP(type, op) \ + __device__ __host__ static inline type operator op(type& val, int) { \ + type ret; \ + ret.x = val.x; \ + ret.y = val.y; \ + val.x op; \ + val.y op; \ + return ret; \ + } -#define DECLOP_2VAR_COMP(type, op) \ -__device__ __host__ static inline bool operator op (type& lhs, type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y); \ -} \ -__device__ __host__ static inline bool operator op (const type& lhs, type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y); \ -} \ -__device__ __host__ static inline bool operator op (type& lhs, const type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y); \ -} \ -__device__ __host__ static inline bool operator op (const type& lhs, const type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y); \ -} +#define DECLOP_2VAR_COMP(type, op) \ + __device__ __host__ static inline bool operator op(type& lhs, type& rhs) { \ + return (lhs.x op rhs.x) && (lhs.y op rhs.y); \ + } \ + __device__ __host__ static inline bool operator op(const type& lhs, type& rhs) { \ + return (lhs.x op rhs.x) && (lhs.y op rhs.y); \ + } \ + __device__ __host__ static inline bool operator op(type& lhs, const type& rhs) { \ + return (lhs.x op rhs.x) && (lhs.y op rhs.y); \ + } \ + __device__ __host__ static inline bool operator op(const type& lhs, const type& rhs) { \ + return (lhs.x op rhs.x) && (lhs.y op rhs.y); \ + } -#define DECLOP_2VAR_1IN_1OUT(type, op) \ -__device__ __host__ static inline type operator op(type &rhs) { \ - type ret; \ - ret.x = op rhs.x; \ - ret.y = op rhs.y; \ - return ret; \ -} +#define DECLOP_2VAR_1IN_1OUT(type, op) \ + __device__ __host__ static inline type operator op(type& rhs) { \ + type ret; \ + ret.x = op rhs.x; \ + ret.y = op rhs.y; \ + return ret; \ + } -#define DECLOP_2VAR_1IN_BOOLOUT(type, op) \ -__device__ __host__ static inline bool operator op (type &rhs) { \ - return (op rhs.x) && (op rhs.y); \ -} +#define DECLOP_2VAR_1IN_BOOLOUT(type, op) \ + __device__ __host__ static inline bool operator op(type& rhs) { \ + return (op rhs.x) && (op rhs.y); \ + } /* Three Element Access */ -#define DECLOP_3VAR_2IN_1OUT(type, op) \ -__device__ __host__ static inline type operator op (const type& lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs.x op rhs.x; \ - ret.y = lhs.y op rhs.y; \ - ret.z = lhs.z op rhs.z; \ - return ret; \ -} +#define DECLOP_3VAR_2IN_1OUT(type, op) \ + __device__ __host__ static inline type operator op(const type& lhs, const type& rhs) { \ + type ret; \ + ret.x = lhs.x op rhs.x; \ + ret.y = lhs.y op rhs.y; \ + ret.z = lhs.z op rhs.z; \ + return ret; \ + } -#define DECLOP_3VAR_SCALE_PRODUCT(type, type1) \ -__device__ __host__ static inline type operator * (const type& lhs, type1 rhs) { \ - type ret; \ - ret.x = lhs.x * rhs; \ - ret.y = lhs.y * rhs; \ - ret.z = lhs.z * rhs; \ - return ret; \ -} \ -\ -__device__ __host__ static inline type operator * (type1 lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs * rhs.x; \ - ret.y = lhs * rhs.y; \ - ret.z = lhs * rhs.z; \ - return ret; \ -} +#define DECLOP_3VAR_SCALE_PRODUCT(type, type1) \ + __device__ __host__ static inline type operator*(const type& lhs, type1 rhs) { \ + type ret; \ + ret.x = lhs.x * rhs; \ + ret.y = lhs.y * rhs; \ + ret.z = lhs.z * rhs; \ + return ret; \ + } \ + \ + __device__ __host__ static inline type operator*(type1 lhs, const type& rhs) { \ + type ret; \ + ret.x = lhs * rhs.x; \ + ret.y = lhs * rhs.y; \ + ret.z = lhs * rhs.z; \ + return ret; \ + } -#define DECLOP_3VAR_ASSIGN(type, op) \ -__device__ __host__ static inline type& operator op ( type& lhs, const type& rhs) { \ - lhs.x op rhs.x; \ - lhs.y op rhs.y; \ - lhs.z op rhs.z; \ - return lhs; \ -} +#define DECLOP_3VAR_ASSIGN(type, op) \ + __device__ __host__ static inline type& operator op(type& lhs, const type& rhs) { \ + lhs.x op rhs.x; \ + lhs.y op rhs.y; \ + lhs.z op rhs.z; \ + return lhs; \ + } -#define DECLOP_3VAR_PREOP(type, op) \ -__device__ __host__ static inline type& operator op (type& val) { \ - op val.x; \ - op val.y; \ - op val.z; \ - return val; \ -} +#define DECLOP_3VAR_PREOP(type, op) \ + __device__ __host__ static inline type& operator op(type& val) { \ + op val.x; \ + op val.y; \ + op val.z; \ + return val; \ + } -#define DECLOP_3VAR_POSTOP(type, op) \ -__device__ __host__ static inline type operator op (type& val, int) { \ - type ret; \ - ret.x = val.x; \ - ret.y = val.y; \ - ret.z = val.z; \ - val.x op; \ - val.y op; \ - val.z op; \ - return ret; \ -} +#define DECLOP_3VAR_POSTOP(type, op) \ + __device__ __host__ static inline type operator op(type& val, int) { \ + type ret; \ + ret.x = val.x; \ + ret.y = val.y; \ + ret.z = val.z; \ + val.x op; \ + val.y op; \ + val.z op; \ + return ret; \ + } -#define DECLOP_3VAR_COMP(type, op) \ -__device__ __host__ static inline bool operator op (type& lhs, type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z); \ -} \ -__device__ __host__ static inline bool operator op (const type& lhs, type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z); \ -} \ -__device__ __host__ static inline bool operator op (type& lhs, const type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z); \ -} \ -__device__ __host__ static inline bool operator op (const type& lhs, const type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z); \ -} \ +#define DECLOP_3VAR_COMP(type, op) \ + __device__ __host__ static inline bool operator op(type& lhs, type& rhs) { \ + return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z); \ + } \ + __device__ __host__ static inline bool operator op(const type& lhs, type& rhs) { \ + return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z); \ + } \ + __device__ __host__ static inline bool operator op(type& lhs, const type& rhs) { \ + return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z); \ + } \ + __device__ __host__ static inline bool operator op(const type& lhs, const type& rhs) { \ + return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z); \ + } -#define DECLOP_3VAR_1IN_1OUT(type, op) \ -__device__ __host__ static inline type operator op(type &rhs) { \ - type ret; \ - ret.x = op rhs.x; \ - ret.y = op rhs.y; \ - ret.z = op rhs.z; \ - return ret; \ -} +#define DECLOP_3VAR_1IN_1OUT(type, op) \ + __device__ __host__ static inline type operator op(type& rhs) { \ + type ret; \ + ret.x = op rhs.x; \ + ret.y = op rhs.y; \ + ret.z = op rhs.z; \ + return ret; \ + } -#define DECLOP_3VAR_1IN_BOOLOUT(type, op) \ -__device__ __host__ static inline bool operator op (type &rhs) { \ - return (op rhs.x) && (op rhs.y) && (op rhs.z); \ -} +#define DECLOP_3VAR_1IN_BOOLOUT(type, op) \ + __device__ __host__ static inline bool operator op(type& rhs) { \ + return (op rhs.x) && (op rhs.y) && (op rhs.z); \ + } /* Four Element Access */ -#define DECLOP_4VAR_2IN_1OUT(type, op) \ -__device__ __host__ static inline type operator op ( const type& lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs.x op rhs.x; \ - ret.y = lhs.y op rhs.y; \ - ret.z = lhs.z op rhs.z; \ - ret.w = lhs.w op rhs.w; \ - return ret; \ -} +#define DECLOP_4VAR_2IN_1OUT(type, op) \ + __device__ __host__ static inline type operator op(const type& lhs, const type& rhs) { \ + type ret; \ + ret.x = lhs.x op rhs.x; \ + ret.y = lhs.y op rhs.y; \ + ret.z = lhs.z op rhs.z; \ + ret.w = lhs.w op rhs.w; \ + return ret; \ + } -#define DECLOP_4VAR_SCALE_PRODUCT(type, type1) \ -__device__ __host__ static inline type operator * (const type& lhs, type1 rhs) { \ - type ret; \ - ret.x = lhs.x * rhs; \ - ret.y = lhs.y * rhs; \ - ret.z = lhs.z * rhs; \ - ret.w = lhs.w * rhs; \ - return ret; \ -} \ -\ -__device__ __host__ static inline type operator * (type1 lhs, const type& rhs) { \ - type ret; \ - ret.x = lhs * rhs.x; \ - ret.y = lhs * rhs.y; \ - ret.z = lhs * rhs.z; \ - ret.w = lhs * rhs.w; \ - return ret; \ -} +#define DECLOP_4VAR_SCALE_PRODUCT(type, type1) \ + __device__ __host__ static inline type operator*(const type& lhs, type1 rhs) { \ + type ret; \ + ret.x = lhs.x * rhs; \ + ret.y = lhs.y * rhs; \ + ret.z = lhs.z * rhs; \ + ret.w = lhs.w * rhs; \ + return ret; \ + } \ + \ + __device__ __host__ static inline type operator*(type1 lhs, const type& rhs) { \ + type ret; \ + ret.x = lhs * rhs.x; \ + ret.y = lhs * rhs.y; \ + ret.z = lhs * rhs.z; \ + ret.w = lhs * rhs.w; \ + return ret; \ + } -#define DECLOP_4VAR_ASSIGN(type, op) \ -__device__ __host__ static inline type& operator op ( type& lhs, const type& rhs) { \ - lhs.x op rhs.x; \ - lhs.y op rhs.y; \ - lhs.z op rhs.z; \ - lhs.w op rhs.w; \ - return lhs; \ -} +#define DECLOP_4VAR_ASSIGN(type, op) \ + __device__ __host__ static inline type& operator op(type& lhs, const type& rhs) { \ + lhs.x op rhs.x; \ + lhs.y op rhs.y; \ + lhs.z op rhs.z; \ + lhs.w op rhs.w; \ + return lhs; \ + } -#define DECLOP_4VAR_PREOP(type, op) \ -__device__ __host__ static inline type& operator op (type& val) { \ - op val.x; \ - op val.y; \ - op val.z; \ - op val.w; \ - return val; \ -} +#define DECLOP_4VAR_PREOP(type, op) \ + __device__ __host__ static inline type& operator op(type& val) { \ + op val.x; \ + op val.y; \ + op val.z; \ + op val.w; \ + return val; \ + } -#define DECLOP_4VAR_POSTOP(type, op) \ -__device__ __host__ static inline type operator op (type& val, int) { \ - type ret; \ - ret.x = val.x; \ - ret.y = val.y; \ - ret.z = val.z; \ - ret.w = val.w; \ - val.x op; \ - val.y op; \ - val.z op; \ - val.w op; \ - return ret; \ -} +#define DECLOP_4VAR_POSTOP(type, op) \ + __device__ __host__ static inline type operator op(type& val, int) { \ + type ret; \ + ret.x = val.x; \ + ret.y = val.y; \ + ret.z = val.z; \ + ret.w = val.w; \ + val.x op; \ + val.y op; \ + val.z op; \ + val.w op; \ + return ret; \ + } -#define DECLOP_4VAR_COMP(type, op) \ -__device__ __host__ static inline bool operator op (type& lhs, type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z) && (lhs.w op rhs.w); \ -} \ -__device__ __host__ static inline bool operator op (const type& lhs, type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z) && (lhs.w op rhs.w); \ -} \ -__device__ __host__ static inline bool operator op (type& lhs, const type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z) && (lhs.w op rhs.w); \ -} \ -__device__ __host__ static inline bool operator op (const type& lhs, const type& rhs) { \ - return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z) && (lhs.w op rhs.w); \ -} +#define DECLOP_4VAR_COMP(type, op) \ + __device__ __host__ static inline bool operator op(type& lhs, type& rhs) { \ + return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z) && (lhs.w op rhs.w); \ + } \ + __device__ __host__ static inline bool operator op(const type& lhs, type& rhs) { \ + return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z) && (lhs.w op rhs.w); \ + } \ + __device__ __host__ static inline bool operator op(type& lhs, const type& rhs) { \ + return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z) && (lhs.w op rhs.w); \ + } \ + __device__ __host__ static inline bool operator op(const type& lhs, const type& rhs) { \ + return (lhs.x op rhs.x) && (lhs.y op rhs.y) && (lhs.z op rhs.z) && (lhs.w op rhs.w); \ + } -#define DECLOP_4VAR_1IN_1OUT(type, op) \ -__device__ __host__ static inline type operator op(type &rhs) { \ - type ret; \ - ret.x = op rhs.x; \ - ret.y = op rhs.y; \ - ret.z = op rhs.z; \ - ret.w = op rhs.w; \ - return ret; \ -} +#define DECLOP_4VAR_1IN_1OUT(type, op) \ + __device__ __host__ static inline type operator op(type& rhs) { \ + type ret; \ + ret.x = op rhs.x; \ + ret.y = op rhs.y; \ + ret.z = op rhs.z; \ + ret.w = op rhs.w; \ + return ret; \ + } -#define DECLOP_4VAR_1IN_BOOLOUT(type, op) \ -__device__ __host__ static inline bool operator op (type &rhs) { \ - return (op rhs.x) && (op rhs.y) && (op rhs.z) && (op rhs.w); \ -} +#define DECLOP_4VAR_1IN_BOOLOUT(type, op) \ + __device__ __host__ static inline bool operator op(type& rhs) { \ + return (op rhs.x) && (op rhs.y) && (op rhs.z) && (op rhs.w); \ + } /* diff --git a/hipamd/include/hip/hcc_detail/host_defines.h b/hipamd/include/hip/hcc_detail/host_defines.h index 479ce07264..af51e9d3fe 100644 --- a/hipamd/include/hip/hcc_detail/host_defines.h +++ b/hipamd/include/hip/hcc_detail/host_defines.h @@ -38,42 +38,40 @@ THE SOFTWARE. /** * Function and kernel markers */ -#define __host__ __attribute__((cpu)) -#define __device__ __attribute__((hc)) +#define __host__ __attribute__((cpu)) +#define __device__ __attribute__((hc)) #if GENERIC_GRID_LAUNCH == 0 -#define __global__ __attribute__((hc_grid_launch)) __attribute__((used)) +#define __global__ __attribute__((hc_grid_launch)) __attribute__((used)) #else - #if __hcc_workweek__ >= 17481 - #define __global__ \ - __attribute__((annotate("__HIP_global_function__"), cpu, hc, used)) - #else - #define __global__ __attribute__((hc, used)) - #endif -#endif //GENERIC_GRID_LAUNCH - -#define __noinline__ __attribute__((noinline)) -#define __forceinline__ __attribute__((always_inline)) +#if __hcc_workweek__ >= 17481 +#define __global__ __attribute__((annotate("__HIP_global_function__"), cpu, hc, used)) +#else +#define __global__ __attribute__((hc, used)) +#endif +#endif // GENERIC_GRID_LAUNCH +#define __noinline__ __attribute__((noinline)) +#define __forceinline__ __attribute__((always_inline)) /* * Variable Type Qualifiers: */ // _restrict is supported by the compiler -#define __shared__ tile_static -#define __constant__ __attribute__((hc)) +#define __shared__ tile_static +#define __constant__ __attribute__((hc)) #elif defined(__clang__) && defined(__HIP__) -#define __host__ __attribute__((host)) -#define __device__ __attribute__((device)) -#define __global__ __attribute__((global)) -#define __shared__ __attribute__((shared)) -#define __constant__ __attribute__((constant)) +#define __host__ __attribute__((host)) +#define __device__ __attribute__((device)) +#define __global__ __attribute__((global)) +#define __shared__ __attribute__((shared)) +#define __constant__ __attribute__((constant)) -#define __noinline__ __attribute__((noinline)) -#define __forceinline__ __attribute__((always_inline)) +#define __noinline__ __attribute__((noinline)) +#define __forceinline__ __attribute__((always_inline)) #else diff --git a/hipamd/include/hip/hcc_detail/macro_based_grid_launch.hpp b/hipamd/include/hip/hcc_detail/macro_based_grid_launch.hpp index f1dfe76245..8726b60dc2 100644 --- a/hipamd/include/hip/hcc_detail/macro_based_grid_launch.hpp +++ b/hipamd/include/hip/hcc_detail/macro_based_grid_launch.hpp @@ -35,970 +35,764 @@ THE SOFTWARE. #include #include -namespace hip_impl -{ - namespace - { - struct New_grid_launch_tag {}; - struct Old_grid_launch_tag {}; +namespace hip_impl { +namespace { +struct New_grid_launch_tag {}; +struct Old_grid_launch_tag {}; - template - class RAII_guard { - D dtor_; - public: - RAII_guard() = default; +template +class RAII_guard { + D dtor_; - RAII_guard(const C& ctor, D dtor) : dtor_{std::move(dtor)} - { - ctor(); - } + public: + RAII_guard() = default; - RAII_guard(const RAII_guard&) = default; - RAII_guard(RAII_guard&&) = default; + RAII_guard(const C& ctor, D dtor) : dtor_{std::move(dtor)} { ctor(); } - RAII_guard& operator=(const RAII_guard&) = default; - RAII_guard& operator=(RAII_guard&&) = default; + RAII_guard(const RAII_guard&) = default; + RAII_guard(RAII_guard&&) = default; - ~RAII_guard() { dtor_(); } - }; + RAII_guard& operator=(const RAII_guard&) = default; + RAII_guard& operator=(RAII_guard&&) = default; - template - RAII_guard make_RAII_guard(const C& ctor, D dtor) - { - return RAII_guard{ctor, std::move(dtor)}; - } + ~RAII_guard() { dtor_(); } +}; - template - using is_new_grid_launch_t = typename std::conditional< - is_callable{}, - New_grid_launch_tag, - Old_grid_launch_tag>::type; +template +RAII_guard make_RAII_guard(const C& ctor, D dtor) { + return RAII_guard{ctor, std::move(dtor)}; +} + +template +using is_new_grid_launch_t = typename std::conditional{}, New_grid_launch_tag, + Old_grid_launch_tag>::type; +} // namespace + +// TODO: - dispatch rank should be derived from the domain dimensions passed +// in, and not always assumed to be 3; + +template +requires(Domain == + {Ts...}) inline void grid_launch_hip_impl_(New_grid_launch_tag, dim3 num_blocks, + dim3 dim_blocks, int group_mem_bytes, + const hc::accelerator_view& acc_v, K k) { + const auto d = + hc::extent<3>{num_blocks.z * dim_blocks.z, num_blocks.y * dim_blocks.y, + num_blocks.x * dim_blocks.x} + .tile_with_dynamic(dim_blocks.z, dim_blocks.y, dim_blocks.x, group_mem_bytes); + + try { + hc::parallel_for_each(acc_v, d, k); + } catch (std::exception& ex) { + std::cerr << "Failed in " << __func__ << ", with exception: " << ex.what() << std::endl; + throw; } +} - // TODO: - dispatch rank should be derived from the domain dimensions passed - // in, and not always assumed to be 3; +// TODO: these are workarounds, they should be removed. - template - requires(Domain == {Ts...}) - inline - void grid_launch_hip_impl_( - New_grid_launch_tag, - dim3 num_blocks, - dim3 dim_blocks, - int group_mem_bytes, - const hc::accelerator_view& acc_v, - K k) - { - const auto d = hc::extent<3>{ - num_blocks.z * dim_blocks.z, - num_blocks.y * dim_blocks.y, - num_blocks.x * dim_blocks.x}.tile_with_dynamic( - dim_blocks.z, - dim_blocks.y, - dim_blocks.x, - group_mem_bytes); +hc::accelerator_view lock_stream_hip_(hipStream_t&, void*&); +void print_prelaunch_trace_(const char*, dim3, dim3, int, hipStream_t); +void unlock_stream_hip_(hipStream_t, void*, const char*, hc::accelerator_view*); - try { - hc::parallel_for_each(acc_v, d, k); - } - catch (std::exception& ex) { - std::cerr << "Failed in " << __func__ << ", with exception: " - << ex.what() << std::endl; - throw; - } +template +requires(Domain == {Ts...}) inline void grid_launch_hip_impl_(New_grid_launch_tag, + dim3 num_blocks, dim3 dim_blocks, + int group_mem_bytes, + hipStream_t stream, + const char* kernel_name, K k) { + void* lck_stream = nullptr; + auto acc_v = lock_stream_hip_(stream, lck_stream); + auto stream_guard = + make_RAII_guard(std::bind(print_prelaunch_trace_, kernel_name, num_blocks, dim_blocks, + group_mem_bytes, stream), + std::bind(unlock_stream_hip_, stream, lck_stream, kernel_name, &acc_v)); + + try { + grid_launch_hip_impl_(New_grid_launch_tag{}, std::move(num_blocks), std::move(dim_blocks), + group_mem_bytes, acc_v, std::move(k)); + } catch (std::exception& ex) { + std::cerr << "Failed in " << __func__ << ", with exception: " << ex.what() << std::endl; + throw; } +} - // TODO: these are workarounds, they should be removed. +template +requires(Domain == + {hipLaunchParm, Ts...}) inline void grid_launch_hip_impl_(Old_grid_launch_tag, + dim3 num_blocks, dim3 dim_blocks, + int group_mem_bytes, + hipStream_t stream, K k) { + grid_launch_hip_impl_(New_grid_launch_tag{}, std::move(num_blocks), std::move(dim_blocks), + group_mem_bytes, std::move(stream), std::move(k)); +} - hc::accelerator_view lock_stream_hip_(hipStream_t&, void*&); - void print_prelaunch_trace_(const char*, dim3, dim3, int, hipStream_t); - void unlock_stream_hip_( - hipStream_t, void*, const char*, hc::accelerator_view*); +template +requires(Domain == {hipLaunchParm, Ts...}) inline void grid_launch_hip_impl_( + Old_grid_launch_tag, dim3 num_blocks, dim3 dim_blocks, int group_mem_bytes, hipStream_t stream, + const char* kernel_name, K k) { + grid_launch_hip_impl_(New_grid_launch_tag{}, std::move(num_blocks), std::move(dim_blocks), + group_mem_bytes, std::move(stream), kernel_name, std::move(k)); +} - template - requires(Domain == {Ts...}) - inline - void grid_launch_hip_impl_( - New_grid_launch_tag, - dim3 num_blocks, - dim3 dim_blocks, - int group_mem_bytes, - hipStream_t stream, - const char* kernel_name, - K k) - { - void* lck_stream = nullptr; - auto acc_v = lock_stream_hip_(stream, lck_stream); - auto stream_guard = make_RAII_guard( - std::bind( - print_prelaunch_trace_, - kernel_name, - num_blocks, - dim_blocks, - group_mem_bytes, - stream), - std::bind( - unlock_stream_hip_, stream, lck_stream, kernel_name, &acc_v)); +template +requires(Domain == {Ts...}) inline std::enable_if_t< + !std::is_function::value> grid_launch_hip_(dim3 num_blocks, dim3 dim_blocks, + int group_mem_bytes, hipStream_t stream, + const char* kernel_name, K k) { + grid_launch_hip_impl_(is_new_grid_launch_t{}, std::move(num_blocks), + std::move(dim_blocks), group_mem_bytes, std::move(stream), kernel_name, + std::move(k)); +} - try { - grid_launch_hip_impl_( - New_grid_launch_tag{}, - std::move(num_blocks), - std::move(dim_blocks), - group_mem_bytes, - acc_v, - std::move(k)); - } - catch (std::exception& ex) { - std::cerr << "Failed in " << __func__ << ", with exception: " - << ex.what() << std::endl; - throw; - } +template +requires(Domain == {Ts...}) inline std::enable_if_t< + !std::is_function::value> grid_launch_hip_(dim3 num_blocks, dim3 dim_blocks, + int group_mem_bytes, hipStream_t stream, K k) { + grid_launch_hip_impl_(is_new_grid_launch_t{}, std::move(num_blocks), + std::move(dim_blocks), group_mem_bytes, std::move(stream), std::move(k)); +} + +// TODO: these are temporary and purposefully noisy and disruptive. +#define make_kernel_name_hip(k, n) \ + HIP_kernel_functor_name_begin##_##k##_##HIP_kernel_functor_name_end##_##n + +#define make_kernel_functor_hip_30(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, \ + p22, p23, p24, p25, p26, p27) \ + struct make_kernel_name_hip(function_name, 28) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + std::decay_t _p16_; \ + std::decay_t _p17_; \ + std::decay_t _p18_; \ + std::decay_t _p19_; \ + std::decay_t _p20_; \ + std::decay_t _p21_; \ + std::decay_t _p22_; \ + std::decay_t _p23_; \ + std::decay_t _p24_; \ + std::decay_t _p25_; \ + std::decay_t _p26_; \ + std::decay_t _p27_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_, _p16_, _p17_, _p18_, _p19_, _p20_, _p21_, \ + _p22_, _p23_, _p24_, _p25_, _p26_, _p27_); \ + } \ } - - template - requires(Domain == {hipLaunchParm, Ts...}) - inline - void grid_launch_hip_impl_( - Old_grid_launch_tag, - dim3 num_blocks, - dim3 dim_blocks, - int group_mem_bytes, - hipStream_t stream, - K k) - { - grid_launch_hip_impl_( - New_grid_launch_tag{}, - std::move(num_blocks), - std::move(dim_blocks), - group_mem_bytes, - std::move(stream), - std::move(k)); +#define make_kernel_functor_hip_29(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, \ + p22, p23, p24, p25, p26) \ + struct make_kernel_name_hip(function_name, 27) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + std::decay_t _p16_; \ + std::decay_t _p17_; \ + std::decay_t _p18_; \ + std::decay_t _p19_; \ + std::decay_t _p20_; \ + std::decay_t _p21_; \ + std::decay_t _p22_; \ + std::decay_t _p23_; \ + std::decay_t _p24_; \ + std::decay_t _p25_; \ + std::decay_t _p26_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_, _p16_, _p17_, _p18_, _p19_, _p20_, _p21_, \ + _p22_, _p23_, _p24_, _p25_, _p26_); \ + } \ } - - template - requires(Domain == {hipLaunchParm, Ts...}) - inline - void grid_launch_hip_impl_( - Old_grid_launch_tag, - dim3 num_blocks, - dim3 dim_blocks, - int group_mem_bytes, - hipStream_t stream, - const char* kernel_name, - K k) - { - grid_launch_hip_impl_( - New_grid_launch_tag{}, - std::move(num_blocks), - std::move(dim_blocks), - group_mem_bytes, - std::move(stream), - kernel_name, - std::move(k)); +#define make_kernel_functor_hip_28(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, \ + p22, p23, p24, p25) \ + struct make_kernel_name_hip(function_name, 26) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + std::decay_t _p16_; \ + std::decay_t _p17_; \ + std::decay_t _p18_; \ + std::decay_t _p19_; \ + std::decay_t _p20_; \ + std::decay_t _p21_; \ + std::decay_t _p22_; \ + std::decay_t _p23_; \ + std::decay_t _p24_; \ + std::decay_t _p25_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_, _p16_, _p17_, _p18_, _p19_, _p20_, _p21_, \ + _p22_, _p23_, _p24_, _p25_); \ + } \ } - - template - requires(Domain == {Ts...}) - inline - std::enable_if_t::value> grid_launch_hip_( - dim3 num_blocks, - dim3 dim_blocks, - int group_mem_bytes, - hipStream_t stream, - const char* kernel_name, - K k) - { - grid_launch_hip_impl_( - is_new_grid_launch_t{}, - std::move(num_blocks), - std::move(dim_blocks), - group_mem_bytes, - std::move(stream), - kernel_name, - std::move(k)); +#define make_kernel_functor_hip_27(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, \ + p22, p23, p24) \ + struct make_kernel_name_hip(function_name, 25) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + std::decay_t _p16_; \ + std::decay_t _p17_; \ + std::decay_t _p18_; \ + std::decay_t _p19_; \ + std::decay_t _p20_; \ + std::decay_t _p21_; \ + std::decay_t _p22_; \ + std::decay_t _p23_; \ + std::decay_t _p24_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_, _p16_, _p17_, _p18_, _p19_, _p20_, _p21_, \ + _p22_, _p23_, _p24_); \ + } \ } - - template - requires(Domain == {Ts...}) - inline - std::enable_if_t::value> grid_launch_hip_( - dim3 num_blocks, - dim3 dim_blocks, - int group_mem_bytes, - hipStream_t stream, - K k) - { - grid_launch_hip_impl_( - is_new_grid_launch_t{}, - std::move(num_blocks), - std::move(dim_blocks), - group_mem_bytes, - std::move(stream), - std::move(k)); +#define make_kernel_functor_hip_26(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, \ + p22, p23) \ + struct make_kernel_name_hip(function_name, 24) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + std::decay_t _p16_; \ + std::decay_t _p17_; \ + std::decay_t _p18_; \ + std::decay_t _p19_; \ + std::decay_t _p20_; \ + std::decay_t _p21_; \ + std::decay_t _p22_; \ + std::decay_t _p23_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_, _p16_, _p17_, _p18_, _p19_, _p20_, _p21_, \ + _p22_, _p23_); \ + } \ } - - // TODO: these are temporary and purposefully noisy and disruptive. - #define make_kernel_name_hip(k, n)\ - HIP_kernel_functor_name_begin ## _ ## k ## _ ## \ - HIP_kernel_functor_name_end ## _ ## n - - #define make_kernel_functor_hip_30(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23,\ - p24, p25, p26, p27)\ - struct make_kernel_name_hip(function_name, 28) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - std::decay_t _p16_;\ - std::decay_t _p17_;\ - std::decay_t _p18_;\ - std::decay_t _p19_;\ - std::decay_t _p20_;\ - std::decay_t _p21_;\ - std::decay_t _p22_;\ - std::decay_t _p23_;\ - std::decay_t _p24_;\ - std::decay_t _p25_;\ - std::decay_t _p26_;\ - std::decay_t _p27_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_, _p16_, _p17_,\ - _p18_, _p19_, _p20_, _p21_, _p22_, _p23_, _p24_, _p25_,\ - _p26_, _p27_);\ - }\ - } - #define make_kernel_functor_hip_29(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23,\ - p24, p25, p26)\ - struct make_kernel_name_hip(function_name, 27) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - std::decay_t _p16_;\ - std::decay_t _p17_;\ - std::decay_t _p18_;\ - std::decay_t _p19_;\ - std::decay_t _p20_;\ - std::decay_t _p21_;\ - std::decay_t _p22_;\ - std::decay_t _p23_;\ - std::decay_t _p24_;\ - std::decay_t _p25_;\ - std::decay_t _p26_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_, _p16_, _p17_,\ - _p18_, _p19_, _p20_, _p21_, _p22_, _p23_, _p24_, _p25_,\ - _p26_);\ - }\ - } - #define make_kernel_functor_hip_28(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23,\ - p24, p25)\ - struct make_kernel_name_hip(function_name, 26) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - std::decay_t _p16_;\ - std::decay_t _p17_;\ - std::decay_t _p18_;\ - std::decay_t _p19_;\ - std::decay_t _p20_;\ - std::decay_t _p21_;\ - std::decay_t _p22_;\ - std::decay_t _p23_;\ - std::decay_t _p24_;\ - std::decay_t _p25_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_, _p16_, _p17_,\ - _p18_, _p19_, _p20_, _p21_, _p22_, _p23_, _p24_, _p25_);\ - }\ - } - #define make_kernel_functor_hip_27(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23,\ - p24)\ - struct make_kernel_name_hip(function_name, 25) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - std::decay_t _p16_;\ - std::decay_t _p17_;\ - std::decay_t _p18_;\ - std::decay_t _p19_;\ - std::decay_t _p20_;\ - std::decay_t _p21_;\ - std::decay_t _p22_;\ - std::decay_t _p23_;\ - std::decay_t _p24_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_, _p16_, _p17_,\ - _p18_, _p19_, _p20_, _p21_, _p22_, _p23_, _p24_);\ - }\ - } - #define make_kernel_functor_hip_26(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23)\ - struct make_kernel_name_hip(function_name, 24) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - std::decay_t _p16_;\ - std::decay_t _p17_;\ - std::decay_t _p18_;\ - std::decay_t _p19_;\ - std::decay_t _p20_;\ - std::decay_t _p21_;\ - std::decay_t _p22_;\ - std::decay_t _p23_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_, _p16_, _p17_,\ - _p18_, _p19_, _p20_, _p21_, _p22_, _p23_);\ - }\ - } - #define make_kernel_functor_hip_25(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22)\ - struct make_kernel_name_hip(function_name, 23) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - std::decay_t _p16_;\ - std::decay_t _p17_;\ - std::decay_t _p18_;\ - std::decay_t _p19_;\ - std::decay_t _p20_;\ - std::decay_t _p21_;\ - std::decay_t _p22_;\ - __attribute__((used, flatten))\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_, _p16_, _p17_,\ - _p18_, _p19_, _p20_, _p21_, _p22_);\ - }\ - } - #define make_kernel_functor_hip_24(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21)\ - struct make_kernel_name_hip(function_name, 22) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - std::decay_t _p16_;\ - std::decay_t _p17_;\ - std::decay_t _p18_;\ - std::decay_t _p19_;\ - std::decay_t _p20_;\ - std::decay_t _p21_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_, _p16_, _p17_,\ - _p18_, _p19_, _p20_, _p21_);\ - }\ - } - #define make_kernel_functor_hip_23(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20)\ - struct make_kernel_name_hip(function_name, 21) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - std::decay_t _p16_;\ - std::decay_t _p17_;\ - std::decay_t _p18_;\ - std::decay_t _p19_;\ - std::decay_t _p20_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_, _p16_, _p17_,\ - _p18_, _p19_, _p20_);\ - }\ - } - #define make_kernel_functor_hip_22(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15, p16, p17, p18, p19)\ - struct make_kernel_name_hip(function_name, 20) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - std::decay_t _p16_;\ - std::decay_t _p17_;\ - std::decay_t _p18_;\ - std::decay_t _p19_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_, _p16_, _p17_,\ - _p18_, _p19_);\ - }\ - } - #define make_kernel_functor_hip_21(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15, p16, p17, p18)\ - struct make_kernel_name_hip(function_name, 19) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - std::decay_t _p16_;\ - std::decay_t _p17_;\ - std::decay_t _p18_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_, _p16_, _p17_,\ - _p18_);\ - }\ - } - #define make_kernel_functor_hip_20(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15, p16, p17)\ - struct make_kernel_name_hip(function_name, 18) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - std::decay_t _p16_;\ - std::decay_t _p17_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_, _p16_, _p17_);\ - }\ - } - #define make_kernel_functor_hip_19(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15, p16)\ - struct make_kernel_name_hip(function_name, 17) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - std::decay_t _p16_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_, _p16_);\ - }\ - } - #define make_kernel_functor_hip_18(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14, p15)\ - struct make_kernel_name_hip(function_name, 16) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - std::decay_t _p15_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_, _p15_);\ - }\ - } - #define make_kernel_functor_hip_17(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13, p14)\ - struct make_kernel_name_hip(function_name, 15) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - std::decay_t _p14_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_, _p14_);\ - }\ - } - #define make_kernel_functor_hip_16(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12, p13)\ - struct make_kernel_name_hip(function_name, 14) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - std::decay_t _p13_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_, _p13_);\ - }\ - } - #define make_kernel_functor_hip_15(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11, p12)\ - struct make_kernel_name_hip(function_name, 13) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - std::decay_t _p12_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_, _p12_);\ - }\ - } - #define make_kernel_functor_hip_14(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,\ - p10, p11)\ - struct make_kernel_name_hip(function_name, 12) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - std::decay_t _p11_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_, _p11_);\ - }\ - } - #define make_kernel_functor_hip_13(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)\ - struct make_kernel_name_hip(function_name, 11) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - std::decay_t _p10_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_,\ - _p10_);\ - }\ - } - #define make_kernel_functor_hip_12(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)\ - struct make_kernel_name_hip(function_name, 10) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - std::decay_t _p9_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_,\ - _p9_);\ - }\ - } - #define make_kernel_functor_hip_11(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8)\ - struct make_kernel_name_hip(function_name, 9) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - std::decay_t _p8_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(\ - _p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_);\ - }\ - } - #define make_kernel_functor_hip_10(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7)\ - struct make_kernel_name_hip(function_name, 8) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - std::decay_t _p7_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_);\ - }\ - } - #define make_kernel_functor_hip_9(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6)\ - struct make_kernel_name_hip(function_name, 7) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - std::decay_t _p6_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_);\ - }\ - } - #define make_kernel_functor_hip_8(\ - function_name, kernel_name, p0, p1, p2, p3, p4, p5)\ - struct make_kernel_name_hip(function_name, 6) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - std::decay_t _p5_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_);\ - }\ - } - #define make_kernel_functor_hip_7(\ - function_name, kernel_name, p0, p1, p2, p3, p4)\ - struct make_kernel_name_hip(function_name, 5) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - std::decay_t _p4_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_);\ - }\ - } - #define make_kernel_functor_hip_6(function_name, kernel_name, p0, p1, p2, p3)\ - struct make_kernel_name_hip(function_name, 4) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - std::decay_t _p3_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(_p0_, _p1_, _p2_, _p3_);\ - }\ - } - #define make_kernel_functor_hip_5(function_name, kernel_name, p0, p1, p2)\ - struct make_kernel_name_hip(function_name, 3) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - std::decay_t _p2_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(_p0_, _p1_, _p2_);\ - }\ - } - #define make_kernel_functor_hip_4(function_name, kernel_name, p0, p1)\ - struct make_kernel_name_hip(function_name, 2) {\ - std::decay_t _p0_;\ - std::decay_t _p1_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(_p0_, _p1_);\ - }\ - } - #define fofo(f, n) kernel_prefix_hip ## f ## kernel_suffix_hip ## n - #define make_kernel_functor_hip_3(function_name, kernel_name, p0)\ - struct make_kernel_name_hip(function_name, 1) {\ - std::decay_t _p0_;\ - void operator()(const hc::tiled_index<3>&) const [[hc]]\ - {\ - kernel_name(_p0_);\ - }\ - } - #define make_kernel_functor_hip_2(function_name, kernel_name)\ - struct make_kernel_name_hip(function_name, 0) {\ - void operator()(const hc::tiled_index<3>&) [[hc]]\ - {\ - return kernel_name(hipLaunchParm{});\ - }\ - } - #define make_kernel_functor_hip_1(...) - #define make_kernel_functor_hip_0(...) - #define make_kernel_functor_hip_(...)\ - overload_macro_hip_(make_kernel_functor_hip_, __VA_ARGS__) +#define make_kernel_functor_hip_25(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, \ + p22) \ + struct make_kernel_name_hip(function_name, 23) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + std::decay_t _p16_; \ + std::decay_t _p17_; \ + std::decay_t _p18_; \ + std::decay_t _p19_; \ + std::decay_t _p20_; \ + std::decay_t _p21_; \ + std::decay_t _p22_; \ + __attribute__((used, flatten)) void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_, _p16_, _p17_, _p18_, _p19_, _p20_, _p21_, \ + _p22_); \ + } \ + } +#define make_kernel_functor_hip_24(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21) \ + struct make_kernel_name_hip(function_name, 22) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + std::decay_t _p16_; \ + std::decay_t _p17_; \ + std::decay_t _p18_; \ + std::decay_t _p19_; \ + std::decay_t _p20_; \ + std::decay_t _p21_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_, _p16_, _p17_, _p18_, _p19_, _p20_, _p21_); \ + } \ + } +#define make_kernel_functor_hip_23(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20) \ + struct make_kernel_name_hip(function_name, 21) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + std::decay_t _p16_; \ + std::decay_t _p17_; \ + std::decay_t _p18_; \ + std::decay_t _p19_; \ + std::decay_t _p20_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_, _p16_, _p17_, _p18_, _p19_, _p20_); \ + } \ + } +#define make_kernel_functor_hip_22(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19) \ + struct make_kernel_name_hip(function_name, 20) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + std::decay_t _p16_; \ + std::decay_t _p17_; \ + std::decay_t _p18_; \ + std::decay_t _p19_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_, _p16_, _p17_, _p18_, _p19_); \ + } \ + } +#define make_kernel_functor_hip_21(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15, p16, p17, p18) \ + struct make_kernel_name_hip(function_name, 19) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + std::decay_t _p16_; \ + std::decay_t _p17_; \ + std::decay_t _p18_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_, _p16_, _p17_, _p18_); \ + } \ + } +#define make_kernel_functor_hip_20(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15, p16, p17) \ + struct make_kernel_name_hip(function_name, 18) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + std::decay_t _p16_; \ + std::decay_t _p17_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_, _p16_, _p17_); \ + } \ + } +#define make_kernel_functor_hip_19(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15, p16) \ + struct make_kernel_name_hip(function_name, 17) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + std::decay_t _p16_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_, _p16_); \ + } \ + } +#define make_kernel_functor_hip_18(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14, p15) \ + struct make_kernel_name_hip(function_name, 16) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + std::decay_t _p15_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_, _p15_); \ + } \ + } +#define make_kernel_functor_hip_17(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13, p14) \ + struct make_kernel_name_hip(function_name, 15) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + std::decay_t _p14_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_, _p14_); \ + } \ + } +#define make_kernel_functor_hip_16(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12, p13) \ + struct make_kernel_name_hip(function_name, 14) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + std::decay_t _p13_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_, _p13_); \ + } \ + } +#define make_kernel_functor_hip_15(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11, p12) \ + struct make_kernel_name_hip(function_name, 13) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + std::decay_t _p12_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_, \ + _p12_); \ + } \ + } +#define make_kernel_functor_hip_14(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10, p11) \ + struct make_kernel_name_hip(function_name, 12) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + std::decay_t _p11_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_, _p11_); \ + } \ + } +#define make_kernel_functor_hip_13(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9, p10) \ + struct make_kernel_name_hip(function_name, 11) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + std::decay_t _p10_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { \ + kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_, _p10_); \ + } \ + } +#define make_kernel_functor_hip_12(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8, \ + p9) \ + struct make_kernel_name_hip(function_name, 10) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + std::decay_t _p9_; \ + void operator()(const hc::tiled_index<3>&) const \ + [[hc]] { kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_, _p9_); } \ + } +#define make_kernel_functor_hip_11(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ + struct make_kernel_name_hip(function_name, 9) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + std::decay_t _p8_; \ + void operator()(const hc::tiled_index<3>&) const \ + [[hc]] { kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_, _p8_); } \ + } +#define make_kernel_functor_hip_10(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6, p7) \ + struct make_kernel_name_hip(function_name, 8) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + std::decay_t _p7_; \ + void operator()(const hc::tiled_index<3>&) const \ + [[hc]] { kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_, _p7_); } \ + } +#define make_kernel_functor_hip_9(function_name, kernel_name, p0, p1, p2, p3, p4, p5, p6) \ + struct make_kernel_name_hip(function_name, 7) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + std::decay_t _p6_; \ + void operator()(const hc::tiled_index<3>&) const \ + [[hc]] { kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_, _p6_); } \ + } +#define make_kernel_functor_hip_8(function_name, kernel_name, p0, p1, p2, p3, p4, p5) \ + struct make_kernel_name_hip(function_name, 6) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + std::decay_t _p5_; \ + void operator()(const hc::tiled_index<3>&) const \ + [[hc]] { kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_, _p5_); } \ + } +#define make_kernel_functor_hip_7(function_name, kernel_name, p0, p1, p2, p3, p4) \ + struct make_kernel_name_hip(function_name, 5) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + std::decay_t _p4_; \ + void operator()(const hc::tiled_index<3>&) const \ + [[hc]] { kernel_name(_p0_, _p1_, _p2_, _p3_, _p4_); } \ + } +#define make_kernel_functor_hip_6(function_name, kernel_name, p0, p1, p2, p3) \ + struct make_kernel_name_hip(function_name, 4) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + std::decay_t _p3_; \ + void operator()(const hc::tiled_index<3>&) const \ + [[hc]] { kernel_name(_p0_, _p1_, _p2_, _p3_); } \ + } +#define make_kernel_functor_hip_5(function_name, kernel_name, p0, p1, p2) \ + struct make_kernel_name_hip(function_name, 3) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + std::decay_t _p2_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { kernel_name(_p0_, _p1_, _p2_); } \ + } +#define make_kernel_functor_hip_4(function_name, kernel_name, p0, p1) \ + struct make_kernel_name_hip(function_name, 2) { \ + std::decay_t _p0_; \ + std::decay_t _p1_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { kernel_name(_p0_, _p1_); } \ + } +#define fofo(f, n) kernel_prefix_hip##f##kernel_suffix_hip##n +#define make_kernel_functor_hip_3(function_name, kernel_name, p0) \ + struct make_kernel_name_hip(function_name, 1) { \ + std::decay_t _p0_; \ + void operator()(const hc::tiled_index<3>&) const [[hc]] { kernel_name(_p0_); } \ + } +#define make_kernel_functor_hip_2(function_name, kernel_name) \ + struct make_kernel_name_hip(function_name, 0) { \ + void operator()(const hc::tiled_index<3>&)[[hc]] { return kernel_name(hipLaunchParm{}); } \ + } +#define make_kernel_functor_hip_1(...) +#define make_kernel_functor_hip_0(...) +#define make_kernel_functor_hip_(...) overload_macro_hip_(make_kernel_functor_hip_, __VA_ARGS__) - #define hipLaunchNamedKernelGGL(\ - function_name,\ - kernel_name,\ - num_blocks,\ - dim_blocks,\ - group_mem_bytes,\ - stream,\ - ...)\ - do {\ - make_kernel_functor_hip_(function_name, kernel_name, __VA_ARGS__)\ - hip_kernel_functor_impl_{__VA_ARGS__};\ - hip_impl::grid_launch_hip_(\ - num_blocks,\ - dim_blocks,\ - group_mem_bytes,\ - stream,\ - #kernel_name,\ - hip_kernel_functor_impl_);\ - } while(0) +#define hipLaunchNamedKernelGGL(function_name, kernel_name, num_blocks, dim_blocks, \ + group_mem_bytes, stream, ...) \ + do { \ + make_kernel_functor_hip_(function_name, kernel_name, __VA_ARGS__) \ + hip_kernel_functor_impl_{__VA_ARGS__}; \ + hip_impl::grid_launch_hip_(num_blocks, dim_blocks, group_mem_bytes, stream, #kernel_name, \ + hip_kernel_functor_impl_); \ + } while (0) - #define hipLaunchKernelGGL(\ - kernel_name, num_blocks, dim_blocks, group_mem_bytes, stream, ...)\ - do {\ - hipLaunchNamedKernelGGL(\ - unnamed,\ - kernel_name,\ - num_blocks,\ - dim_blocks,\ - group_mem_bytes,\ - stream,\ - ##__VA_ARGS__);\ - } while (0) +#define hipLaunchKernelGGL(kernel_name, num_blocks, dim_blocks, group_mem_bytes, stream, ...) \ + do { \ + hipLaunchNamedKernelGGL(unnamed, kernel_name, num_blocks, dim_blocks, group_mem_bytes, \ + stream, ##__VA_ARGS__); \ + } while (0) - #define hipLaunchKernel(\ - kernel_name, num_blocks, dim_blocks, group_mem_bytes, stream, ...)\ - do {\ - hipLaunchKernelGGL(\ - kernel_name,\ - num_blocks,\ - dim_blocks,\ - group_mem_bytes,\ - stream,\ - hipLaunchParm{},\ - ##__VA_ARGS__);\ - } while(0) -} \ No newline at end of file +#define hipLaunchKernel(kernel_name, num_blocks, dim_blocks, group_mem_bytes, stream, ...) \ + do { \ + hipLaunchKernelGGL(kernel_name, num_blocks, dim_blocks, group_mem_bytes, stream, \ + hipLaunchParm{}, ##__VA_ARGS__); \ + } while (0) +} // namespace hip_impl \ No newline at end of file diff --git a/hipamd/include/hip/hcc_detail/math_functions.h b/hipamd/include/hip/hcc_detail/math_functions.h index 7272639d70..5482f34093 100644 --- a/hipamd/include/hip/hcc_detail/math_functions.h +++ b/hipamd/include/hip/hcc_detail/math_functions.h @@ -24,7 +24,7 @@ THE SOFTWARE. #define HIP_INCLUDE_HIP_HCC_DETAIL_MATH_FUNCTIONS_H #if defined(__HCC__) - #include +#include #endif @@ -48,7 +48,7 @@ __device__ float cospif(float x); //__device__ float cyl_bessel_i0f(float x); //__device__ float cyl_bessel_i1f(float x); __device__ float erfcf(float x); -__device__ float erfcinvf(float y); +__device__ float erfcinvf(float y); __device__ float erfcxf(float x); __device__ float erff(float x); __device__ float erfinvf(float y); @@ -91,11 +91,11 @@ __device__ float norm3df(float a, float b, float c); __device__ float norm4df(float a, float b, float c, float d); __device__ float normcdff(float y); __device__ float normcdfinvf(float y); -__device__ float normf(int dim, const float *a); +__device__ float normf(int dim, const float* a); __device__ float powf(float x, float y); __device__ float rcbrtf(float x); __device__ float remainderf(float x, float y); -__device__ float remquof(float x, float y, int *quo); +__device__ float remquof(float x, float y, int* quo); __device__ float rhypotf(float x, float y); __device__ float rintf(float x); __device__ float rnorm3df(float a, float b, float c); @@ -106,8 +106,8 @@ __device__ float rsqrtf(float x); __device__ float scalblnf(float x, long int n); __device__ float scalbnf(float x, int n); __device__ int signbit(float a); -__device__ void sincosf(float x, float *sptr, float *cptr); -__device__ void sincospif(float x, float *sptr, float *cptr); +__device__ void sincosf(float x, float* sptr, float* cptr); +__device__ void sincospif(float x, float* sptr, float* cptr); __device__ float sinf(float x); __device__ float sinhf(float x); __device__ float sinpif(float x); @@ -151,7 +151,7 @@ __device__ double fma(double x, double y, double z); __device__ double fmax(double x, double y); __device__ double fmin(double x, double y); __device__ double fmod(double x, double y); -__device__ double frexp(double x, int *nptr); +__device__ double frexp(double x, int* nptr); __device__ double hypot(double x, double y); __device__ int ilogb(double x); __device__ int isfinite(double x); @@ -195,8 +195,8 @@ __device__ double scalbln(double x, long int n); __device__ double scalbn(double x, int n); __device__ int signbit(double a); __device__ double sin(double a); -__device__ void sincos(double x, double *sptr, double *cptr); -__device__ void sincospi(double x, double *sptr, double *cptr); +__device__ void sincos(double x, double* sptr, double* cptr); +__device__ void sincospi(double x, double* sptr, double* cptr); __device__ double sinh(double x); __device__ double sinpi(double x); __device__ double sqrt(double x); @@ -213,45 +213,25 @@ __device__ double yn(int n, double x); #ifdef HIP_FAST_MATH // Single Precision Precise Math when enabled -__device__ inline float cosf(float x) { - return __hip_fast_cosf(x); -} +__device__ inline float cosf(float x) { return __hip_fast_cosf(x); } -__device__ inline float exp10f(float x) { - return __hip_fast_exp10f(x); -} +__device__ inline float exp10f(float x) { return __hip_fast_exp10f(x); } -__device__ inline float expf(float x) { - return __hip_fast_expf(x); -} +__device__ inline float expf(float x) { return __hip_fast_expf(x); } -__device__ inline float log10f(float x) { - return __hip_fast_log10f(x); -} +__device__ inline float log10f(float x) { return __hip_fast_log10f(x); } -__device__ inline float log2f(float x) { - return __hip_fast_log2f(x); -} +__device__ inline float log2f(float x) { return __hip_fast_log2f(x); } -__device__ inline float logf(float x) { - return __hip_fast_logf(x); -} +__device__ inline float logf(float x) { return __hip_fast_logf(x); } -__device__ inline float powf(float base, float exponent) { - return __hip_fast_powf(base, exponent); -} +__device__ inline float powf(float base, float exponent) { return __hip_fast_powf(base, exponent); } -__device__ inline void sincosf(float x, float *s, float *c) { - return __hip_fast_sincosf(x, s, c); -} +__device__ inline void sincosf(float x, float* s, float* c) { return __hip_fast_sincosf(x, s, c); } -__device__ inline float sinf(float x) { - return __hip_fast_sinf(x); -} +__device__ inline float sinf(float x) { return __hip_fast_sinf(x); } -__device__ inline float tanf(float x) { - return __hip_fast_tanf(x); -} +__device__ inline float tanf(float x) { return __hip_fast_tanf(x); } #else diff --git a/hipamd/include/hip/hcc_detail/program_state.hpp b/hipamd/include/hip/hcc_detail/program_state.hpp index f7de214f10..b6ccafb205 100644 --- a/hipamd/include/hip/hcc_detail/program_state.hpp +++ b/hipamd/include/hip/hcc_detail/program_state.hpp @@ -36,49 +36,33 @@ THE SOFTWARE. struct ihipModuleSymbol_t; using hipFunction_t = ihipModuleSymbol_t*; -namespace std -{ - template<> - struct hash { - size_t operator()(hsa_agent_t x) const - { - return hash{}(x.handle); - } - }; -} +namespace std { +template <> +struct hash { + size_t operator()(hsa_agent_t x) const { return hash{}(x.handle); } +}; +} // namespace std -inline -constexpr -bool operator==(hsa_agent_t x, hsa_agent_t y) -{ - return x.handle == y.handle; -} +inline constexpr bool operator==(hsa_agent_t x, hsa_agent_t y) { return x.handle == y.handle; } -namespace hip_impl -{ - struct Kernel_descriptor { - std::uint64_t kernel_object_; - std::uint32_t group_size_; - std::uint32_t private_size_; - std::string name_; +namespace hip_impl { +struct Kernel_descriptor { + std::uint64_t kernel_object_; + std::uint32_t group_size_; + std::uint32_t private_size_; + std::string name_; - operator hipFunction_t() const - { // TODO: this is awful and only meant for illustration. - return reinterpret_cast( - const_cast(this)); - } - }; + operator hipFunction_t() const { // TODO: this is awful and only meant for illustration. + return reinterpret_cast(const_cast(this)); + } +}; - const std::unordered_map< - hsa_agent_t, std::vector>& executables(); - const std::unordered_map< - std::uintptr_t, - std::vector>>& functions(); - const std::unordered_map& function_names(); - std::unordered_map& globals(); +const std::unordered_map>& executables(); +const std::unordered_map>>& +functions(); +const std::unordered_map& function_names(); +std::unordered_map& globals(); - hsa_executable_t load_executable( - const std::string& file, - hsa_executable_t executable, - hsa_agent_t agent); -} // Namespace hip_impl. +hsa_executable_t load_executable(const std::string& file, hsa_executable_t executable, + hsa_agent_t agent); +} // Namespace hip_impl. diff --git a/hipamd/include/hip/hcc_detail/surface_functions.h b/hipamd/include/hip/hcc_detail/surface_functions.h index 2d4c6e4f6d..562cc440ed 100644 --- a/hipamd/include/hip/hcc_detail/surface_functions.h +++ b/hipamd/include/hip/hcc_detail/surface_functions.h @@ -29,32 +29,32 @@ THE SOFTWARE. #define __SURFACE_FUNCTIONS_DECL__ static __inline__ __device__ template -__SURFACE_FUNCTIONS_DECL__ void surf2Dread(T* data, hipSurfaceObject_t surfObj, int x, int y, int boundaryMode = hipBoundaryModeZero) -{ - hipArray* arrayPtr = (hipArray*) surfObj; +__SURFACE_FUNCTIONS_DECL__ void surf2Dread(T* data, hipSurfaceObject_t surfObj, int x, int y, + int boundaryMode = hipBoundaryModeZero) { + hipArray* arrayPtr = (hipArray*)surfObj; size_t width = arrayPtr->width; size_t height = arrayPtr->height; int32_t xOffset = x / sizeof(T); - T* dataPtr = (T*) arrayPtr->data; - if((xOffset > width) || (xOffset < 0) || (y > height) ||(y < 0)) { - if(boundaryMode == hipBoundaryModeZero) { + T* dataPtr = (T*)arrayPtr->data; + if ((xOffset > width) || (xOffset < 0) || (y > height) || (y < 0)) { + if (boundaryMode == hipBoundaryModeZero) { *data = 0; } } else { - *data = *(dataPtr + y*width + xOffset); + *data = *(dataPtr + y * width + xOffset); } } template -__SURFACE_FUNCTIONS_DECL__ void surf2Dwrite(T data, hipSurfaceObject_t surfObj, int x, int y, int boundaryMode = hipBoundaryModeZero) -{ - hipArray* arrayPtr = (hipArray*) surfObj; +__SURFACE_FUNCTIONS_DECL__ void surf2Dwrite(T data, hipSurfaceObject_t surfObj, int x, int y, + int boundaryMode = hipBoundaryModeZero) { + hipArray* arrayPtr = (hipArray*)surfObj; size_t width = arrayPtr->width; size_t height = arrayPtr->height; int32_t xOffset = x / sizeof(T); - T* dataPtr = (T*) arrayPtr->data; - if(!((xOffset > width) || (xOffset < 0) || (y > height) ||(y < 0))){ - *(dataPtr +y*width + xOffset) = data; + T* dataPtr = (T*)arrayPtr->data; + if (!((xOffset > width) || (xOffset < 0) || (y > height) || (y < 0))) { + *(dataPtr + y * width + xOffset) = data; } } diff --git a/hipamd/include/hip/hcc_detail/texture_functions.h b/hipamd/include/hip/hcc_detail/texture_functions.h index 3675c0639d..7ab84695f3 100644 --- a/hipamd/include/hip/hcc_detail/texture_functions.h +++ b/hipamd/include/hip/hcc_detail/texture_functions.h @@ -35,2936 +35,2966 @@ union TData { #define __TEXTURE_FUNCTIONS_DECL__ static __inline__ __device__ #define ADDRESS_SPACE_2 __attribute__((address_space(2))) -#define TEXTURE_PARAMETERS_INIT \ - unsigned int ADDRESS_SPACE_2 *i = (unsigned int ADDRESS_SPACE_2*)textureObject; \ - unsigned int ADDRESS_SPACE_2 *s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD; \ +#define TEXTURE_PARAMETERS_INIT \ + unsigned int ADDRESS_SPACE_2* i = (unsigned int ADDRESS_SPACE_2*)textureObject; \ + unsigned int ADDRESS_SPACE_2* s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD; \ TData texel; -#define TEXTURE_REF_PARAMETERS_INIT \ - unsigned int ADDRESS_SPACE_2 *i = (unsigned int ADDRESS_SPACE_2*)texRef.textureObject; \ - unsigned int ADDRESS_SPACE_2 *s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD; \ +#define TEXTURE_REF_PARAMETERS_INIT \ + unsigned int ADDRESS_SPACE_2* i = (unsigned int ADDRESS_SPACE_2*)texRef.textureObject; \ + unsigned int ADDRESS_SPACE_2* s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD; \ TData texel; -#define TEXTURE_SET_FLOAT \ - *retVal = texel.f.x; +#define TEXTURE_SET_FLOAT *retVal = texel.f.x; -#define TEXTURE_SET_SIGNED \ - *retVal = texel.i.x; +#define TEXTURE_SET_SIGNED *retVal = texel.i.x; -#define TEXTURE_SET_UNSIGNED \ - *retVal = texel.u.x; +#define TEXTURE_SET_UNSIGNED *retVal = texel.u.x; -#define TEXTURE_SET_FLOAT_X \ - retVal->x = texel.f.x; +#define TEXTURE_SET_FLOAT_X retVal->x = texel.f.x; -#define TEXTURE_SET_SIGNED_X \ - retVal->x = texel.i.x; +#define TEXTURE_SET_SIGNED_X retVal->x = texel.i.x; -#define TEXTURE_SET_UNSIGNED_X \ - retVal->x = texel.u.x; +#define TEXTURE_SET_UNSIGNED_X retVal->x = texel.u.x; -#define TEXTURE_SET_FLOAT_XY \ - retVal->x = texel.f.x; \ +#define TEXTURE_SET_FLOAT_XY \ + retVal->x = texel.f.x; \ retVal->y = texel.f.y; -#define TEXTURE_SET_SIGNED_XY \ - retVal->x = texel.i.x; \ +#define TEXTURE_SET_SIGNED_XY \ + retVal->x = texel.i.x; \ retVal->y = texel.i.y; -#define TEXTURE_SET_UNSIGNED_XY \ - retVal->x = texel.u.x; \ +#define TEXTURE_SET_UNSIGNED_XY \ + retVal->x = texel.u.x; \ retVal->y = texel.u.y; -#define TEXTURE_SET_FLOAT_XYZW \ - retVal->x = texel.f.x; \ - retVal->y = texel.f.y; \ - retVal->z = texel.f.z; \ +#define TEXTURE_SET_FLOAT_XYZW \ + retVal->x = texel.f.x; \ + retVal->y = texel.f.y; \ + retVal->z = texel.f.z; \ retVal->w = texel.f.w; -#define TEXTURE_SET_SIGNED_XYZW \ - retVal->x = texel.i.x; \ - retVal->y = texel.i.y; \ - retVal->z = texel.i.z; \ +#define TEXTURE_SET_SIGNED_XYZW \ + retVal->x = texel.i.x; \ + retVal->y = texel.i.y; \ + retVal->z = texel.i.z; \ retVal->w = texel.i.w; -#define TEXTURE_SET_UNSIGNED_XYZW \ - retVal->x = texel.u.x; \ - retVal->y = texel.u.y; \ - retVal->z = texel.u.z; \ +#define TEXTURE_SET_UNSIGNED_XYZW \ + retVal->x = texel.u.x; \ + retVal->y = texel.u.y; \ + retVal->z = texel.u.z; \ retVal->w = texel.u.w; -#define TEXTURE_RETURN_CHAR \ - return texel.i.x; +#define TEXTURE_RETURN_CHAR return texel.i.x; -#define TEXTURE_RETURN_UCHAR \ - return texel.u.x; +#define TEXTURE_RETURN_UCHAR return texel.u.x; -#define TEXTURE_RETURN_SHORT \ - return texel.i.x; +#define TEXTURE_RETURN_SHORT return texel.i.x; -#define TEXTURE_RETURN_USHORT \ - return texel.u.x; +#define TEXTURE_RETURN_USHORT return texel.u.x; -#define TEXTURE_RETURN_INT \ - return texel.i.x; +#define TEXTURE_RETURN_INT return texel.i.x; -#define TEXTURE_RETURN_UINT \ - return texel.u.x; +#define TEXTURE_RETURN_UINT return texel.u.x; -#define TEXTURE_RETURN_FLOAT \ - return texel.f.x; +#define TEXTURE_RETURN_FLOAT return texel.f.x; -#define TEXTURE_RETURN_SIGNED \ - return texel.i.x; +#define TEXTURE_RETURN_SIGNED return texel.i.x; -#define TEXTURE_RETURN_UNSIGNED \ - return texel.u.x; +#define TEXTURE_RETURN_UNSIGNED return texel.u.x; -#define TEXTURE_RETURN_CHAR_X \ - return char1(texel.i.x); +#define TEXTURE_RETURN_CHAR_X return char1(texel.i.x); -#define TEXTURE_RETURN_UCHAR_X \ - return uchar1(texel.u.x); +#define TEXTURE_RETURN_UCHAR_X return uchar1(texel.u.x); -#define TEXTURE_RETURN_SHORT_X \ - return short1(texel.i.x); +#define TEXTURE_RETURN_SHORT_X return short1(texel.i.x); -#define TEXTURE_RETURN_USHORT_X \ - return ushort1(texel.u.x); +#define TEXTURE_RETURN_USHORT_X return ushort1(texel.u.x); -#define TEXTURE_RETURN_INT_X \ - return int1(texel.i.x); +#define TEXTURE_RETURN_INT_X return int1(texel.i.x); -#define TEXTURE_RETURN_UINT_X \ - return uint1(texel.u.x); +#define TEXTURE_RETURN_UINT_X return uint1(texel.u.x); -#define TEXTURE_RETURN_FLOAT_X \ - return float1(texel.f.x); +#define TEXTURE_RETURN_FLOAT_X return float1(texel.f.x); -#define TEXTURE_RETURN_CHAR_XY \ - return char2(texel.i.x, texel.i.y); +#define TEXTURE_RETURN_CHAR_XY return char2(texel.i.x, texel.i.y); -#define TEXTURE_RETURN_UCHAR_XY \ - return uchar2(texel.u.x, texel.u.y); +#define TEXTURE_RETURN_UCHAR_XY return uchar2(texel.u.x, texel.u.y); -#define TEXTURE_RETURN_SHORT_XY \ - return short2(texel.i.x, texel.i.y); +#define TEXTURE_RETURN_SHORT_XY return short2(texel.i.x, texel.i.y); -#define TEXTURE_RETURN_USHORT_XY \ - return ushort2(texel.u.x, texel.u.y); +#define TEXTURE_RETURN_USHORT_XY return ushort2(texel.u.x, texel.u.y); -#define TEXTURE_RETURN_INT_XY \ - return int2(texel.i.x, texel.i.y); +#define TEXTURE_RETURN_INT_XY return int2(texel.i.x, texel.i.y); -#define TEXTURE_RETURN_UINT_XY \ - return uint2(texel.u.x, texel.u.y); +#define TEXTURE_RETURN_UINT_XY return uint2(texel.u.x, texel.u.y); -#define TEXTURE_RETURN_FLOAT_XY \ - return float2(texel.f.x, texel.f.y); +#define TEXTURE_RETURN_FLOAT_XY return float2(texel.f.x, texel.f.y); -#define TEXTURE_RETURN_CHAR_XYZW \ - return char4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); +#define TEXTURE_RETURN_CHAR_XYZW return char4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); -#define TEXTURE_RETURN_UCHAR_XYZW \ - return uchar4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); +#define TEXTURE_RETURN_UCHAR_XYZW return uchar4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); -#define TEXTURE_RETURN_SHORT_XYZW \ - return short4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); +#define TEXTURE_RETURN_SHORT_XYZW return short4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); -#define TEXTURE_RETURN_USHORT_XYZW \ - return ushort4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); +#define TEXTURE_RETURN_USHORT_XYZW return ushort4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); -#define TEXTURE_RETURN_INT_XYZW \ - return int4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); +#define TEXTURE_RETURN_INT_XYZW return int4(texel.i.x, texel.i.y, texel.i.z, texel.i.w); -#define TEXTURE_RETURN_UINT_XYZW \ - return uint4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); +#define TEXTURE_RETURN_UINT_XYZW return uint4(texel.u.x, texel.u.y, texel.u.z, texel.u.w); -#define TEXTURE_RETURN_FLOAT_XYZW \ - return float4(texel.f.x, texel.f.y, texel.f.z, texel.f.w); +#define TEXTURE_RETURN_FLOAT_XYZW return float4(texel.f.x, texel.f.y, texel.f.z, texel.f.w); extern "C" { -hc::short_vector::float4::vector_value_type -__ockl_image_sample_1D(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - float c) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_1D(unsigned int ADDRESS_SPACE_2* i, + unsigned int ADDRESS_SPACE_2* s, + float c)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_1Da(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float2::vector_value_type c) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_1Da( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float2::vector_value_type c)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_2D(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float2::vector_value_type c) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_2D( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float2::vector_value_type c)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_2Da(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float4::vector_value_type c) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_2Da( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float4::vector_value_type c)[[hc]]; -float -__ockl_image_sample_2Dad(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float4::vector_value_type c) [[hc]]; +float __ockl_image_sample_2Dad(unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float4::vector_value_type c)[[hc]]; -float -__ockl_image_sample_2Dd(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float2::vector_value_type c) [[hc]]; +float __ockl_image_sample_2Dd(unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float2::vector_value_type c)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_3D(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float4::vector_value_type c) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_3D( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float4::vector_value_type c)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_grad_1D(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - float c, - float dx, - float dy) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_grad_1D( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, float c, float dx, + float dy)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_grad_1Da(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float2::vector_value_type c, - float dx, - float dy) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_grad_1Da( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float2::vector_value_type c, float dx, float dy)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_grad_2D(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float2::vector_value_type c, - hc::short_vector::float2::vector_value_type dx, - hc::short_vector::float2::vector_value_type dy) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_grad_2D( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float2::vector_value_type c, hc::short_vector::float2::vector_value_type dx, + hc::short_vector::float2::vector_value_type dy)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_grad_2Da(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float4::vector_value_type c, - hc::short_vector::float2::vector_value_type dx, - hc::short_vector::float2::vector_value_type dy) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_grad_2Da( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float4::vector_value_type c, hc::short_vector::float2::vector_value_type dx, + hc::short_vector::float2::vector_value_type dy)[[hc]]; -float -__ockl_image_sample_grad_2Dad(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float4::vector_value_type c, - hc::short_vector::float2::vector_value_type dx, - hc::short_vector::float2::vector_value_type dy) [[hc]]; +float __ockl_image_sample_grad_2Dad(unsigned int ADDRESS_SPACE_2* i, + unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float4::vector_value_type c, + hc::short_vector::float2::vector_value_type dx, + hc::short_vector::float2::vector_value_type dy)[[hc]]; -float -__ockl_image_sample_grad_2Dd(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float2::vector_value_type c, - hc::short_vector::float2::vector_value_type dx, - hc::short_vector::float2::vector_value_type dy) [[hc]]; +float __ockl_image_sample_grad_2Dd(unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float2::vector_value_type c, + hc::short_vector::float2::vector_value_type dx, + hc::short_vector::float2::vector_value_type dy)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_grad_3D(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float4::vector_value_type c, - hc::short_vector::float4::vector_value_type dx, - hc::short_vector::float4::vector_value_type dy) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_grad_3D( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float4::vector_value_type c, hc::short_vector::float4::vector_value_type dx, + hc::short_vector::float4::vector_value_type dy)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_lod_1D(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - float c, - float l) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_lod_1D( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, float c, float l)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_lod_1Da(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float2::vector_value_type c, - float l) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_lod_1Da( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float2::vector_value_type c, float l)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_lod_2D(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float2::vector_value_type c, - float l) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_lod_2D( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float2::vector_value_type c, float l)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_lod_2Da(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float4::vector_value_type c, - float l) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_lod_2Da( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float4::vector_value_type c, float l)[[hc]]; -float -__ockl_image_sample_lod_2Dad(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float4::vector_value_type c, - float l) [[hc]]; +float __ockl_image_sample_lod_2Dad(unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float4::vector_value_type c, float l)[[hc]]; -float -__ockl_image_sample_lod_2Dd(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float2::vector_value_type c, - float l) [[hc]]; +float __ockl_image_sample_lod_2Dd(unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float2::vector_value_type c, float l)[[hc]]; -hc::short_vector::float4::vector_value_type -__ockl_image_sample_lod_3D(unsigned int ADDRESS_SPACE_2 * i, - unsigned int ADDRESS_SPACE_2 * s, - hc::short_vector::float4::vector_value_type c, - float l) [[hc]]; +hc::short_vector::float4::vector_value_type __ockl_image_sample_lod_3D( + unsigned int ADDRESS_SPACE_2* i, unsigned int ADDRESS_SPACE_2* s, + hc::short_vector::float4::vector_value_type c, float l)[[hc]]; } //////////////////////////////////////////////////////////// // Texture object APIs //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char1* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char2* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(char4* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned char *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned char* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar1* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar2* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uchar4* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short1* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short2* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(short4* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned short *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned short* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); - TEXTURE_SET_SIGNED; + TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort1* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort2* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(ushort4* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int1* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int2* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(int4* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned int *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(unsigned int* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint1* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint2* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(uint4* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float1* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float2* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1Dfetch(float4* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_FLOAT_XYZW; } template -__TEXTURE_FUNCTIONS_DECL__ T tex1Dfetch(hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ T tex1Dfetch(hipTextureObject_t textureObject, int x) { T ret; tex1Dfetch(&ret, textureObject, x); return ret; } //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1D(char *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(char* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(char1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(char1* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(char2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(char2* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(char4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(char4* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned char *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned char* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar1* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar2* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(uchar4* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(short *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(short* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(short1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(short1* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(short2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(short2* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(short4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(short4* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned short *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned short* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort1* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort2* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(ushort4* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(int *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(int* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(int1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(int1* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(int2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(int2* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(int4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(int4* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned int *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(unsigned int* retVal, hipTextureObject_t textureObject, + int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(uint1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(uint1* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(uint2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(uint2* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(uint4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(uint4* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(float *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(float* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(float1 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(float1* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(float2 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(float2* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1D(float4 *retVal, hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1D(float4* retVal, hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_SET_FLOAT_XYZW; } template -__TEXTURE_FUNCTIONS_DECL__ T tex1D(hipTextureObject_t textureObject, int x) -{ +__TEXTURE_FUNCTIONS_DECL__ T tex1D(hipTextureObject_t textureObject, int x) { T ret; tex1D(&ret, textureObject, x); return ret; } //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char1 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char1* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char2 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char2* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char4 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(char4* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned char *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned char* retVal, hipTextureObject_t textureObject, + float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar1 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar1* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar2 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar2* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar4 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uchar4* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short1 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short1* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short2 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short2* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short4 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(short4* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned short *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned short* retVal, hipTextureObject_t textureObject, + float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort1 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort1* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort2 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort2* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort4 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(ushort4* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int1 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int1* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int2 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int2* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int4 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(int4* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned int *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(unsigned int* retVal, hipTextureObject_t textureObject, + float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint1 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint1* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint2 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint2* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint4 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(uint4* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float1 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float1* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float2 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float2* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float4 *retVal, hipTextureObject_t textureObject, float x, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLod(float4* retVal, hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_SET_FLOAT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ T tex1DLod(hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ T tex1DLod(hipTextureObject_t textureObject, float x, float level) { T ret; tex1DLod(&ret, textureObject, x, level); return ret; } //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char1 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char1* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char2 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char2* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char4 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(char4* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned char *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned char* retVal, hipTextureObject_t textureObject, + float x, float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar1 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar1* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar2 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar2* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar4 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uchar4* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short1 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short1* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short2 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short2* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short4 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(short4* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned short *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned short* retVal, hipTextureObject_t textureObject, + float x, float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort1 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort1* retVal, hipTextureObject_t textureObject, + float x, float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort2 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort2* retVal, hipTextureObject_t textureObject, + float x, float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort4 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(ushort4* retVal, hipTextureObject_t textureObject, + float x, float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int1 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int1* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int2 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int2* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int4 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(int4* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned int *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(unsigned int* retVal, hipTextureObject_t textureObject, + float x, float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint1 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint1* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint2 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint2* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint4 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(uint4* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float1 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float1* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float2 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float2* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float4 *retVal, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DGrad(float4* retVal, hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_SET_FLOAT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ T tex1DGrad(hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ T tex1DGrad(hipTextureObject_t textureObject, float x, float dx, + float dy) { T ret; tex1DLod(&ret, textureObject, x, dx, dy); return ret; } //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex2D(char *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(char* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(char1 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(char1* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(char2 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(char2* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(char4 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(char4* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned char *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned char* retVal, hipTextureObject_t textureObject, + float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar1 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar1* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar2 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar2* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar4 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(uchar4* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(short *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(short* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(short1 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(short1* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(short2 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(short2* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(short4 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(short4* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned short *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned short* retVal, hipTextureObject_t textureObject, + float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort1 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort1* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort2 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort2* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort4 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(ushort4* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(int *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(int* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(int1 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(int1* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(int2 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(int2* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(int4 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(int4* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned int *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(unsigned int* retVal, hipTextureObject_t textureObject, + float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(uint1 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(uint1* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(uint2 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(uint2* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(uint4 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(uint4* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(float *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(float* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(float1 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(float1* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(float2 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(float2* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2D(float4 *retVal, hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2D(float4* retVal, hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_SET_FLOAT_XYZW; } template -__TEXTURE_FUNCTIONS_DECL__ T tex2D(hipTextureObject_t textureObject, float x, float y) -{ +__TEXTURE_FUNCTIONS_DECL__ T tex2D(hipTextureObject_t textureObject, float x, float y) { T ret; tex2D(&ret, textureObject, x, y); return ret; } //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char1 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char1* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char2 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char2* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char4 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(char4* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned char *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned char* retVal, hipTextureObject_t textureObject, + float x, float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar1 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar1* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar2 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar2* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar4 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uchar4* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short1 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short1* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short2 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short2* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short4 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(short4* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned short *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned short* retVal, hipTextureObject_t textureObject, + float x, float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort1 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort1* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort2 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort2* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort4 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(ushort4* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int1 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int1* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int2 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int2* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int4 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(int4* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned int *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(unsigned int* retVal, hipTextureObject_t textureObject, + float x, float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint1 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint1* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint2 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint2* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint4 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(uint4* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float1 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float1* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float2 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float2* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float4 *retVal, hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLod(float4* retVal, hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_SET_FLOAT_XYZW; } template -__TEXTURE_FUNCTIONS_DECL__ T tex2DLod(hipTextureObject_t textureObject, float x, float y, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ T tex2DLod(hipTextureObject_t textureObject, float x, float y, + float level) { T ret; tex2DLod(&ret, textureObject, x, y, level); return ret; } //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex3D(char *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(char* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(char1 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(char1* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(char2 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(char2* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(char4 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(char4* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned char *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned char* retVal, hipTextureObject_t textureObject, + float x, float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar1 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar1* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar2 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar2* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar4 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(uchar4* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(short *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(short* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(short1 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(short1* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(short2 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(short2* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(short4 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(short4* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned short *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned short* retVal, hipTextureObject_t textureObject, + float x, float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort1 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort1* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort2 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort2* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort4 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(ushort4* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(int *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(int* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(int1 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(int1* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(int2 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(int2* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(int4 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(int4* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned int *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(unsigned int* retVal, hipTextureObject_t textureObject, + float x, float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(uint1 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(uint1* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(uint2 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(uint2* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(uint4 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(uint4* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(float *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(float* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(float1 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(float1* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(float2 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(float2* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3D(float4 *retVal, hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3D(float4* retVal, hipTextureObject_t textureObject, float x, + float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_SET_FLOAT_XYZW; } template -__TEXTURE_FUNCTIONS_DECL__ T tex3D(hipTextureObject_t textureObject, float x, float y, float z) -{ +__TEXTURE_FUNCTIONS_DECL__ T tex3D(hipTextureObject_t textureObject, float x, float y, float z) { T ret; tex3D(&ret, textureObject, x, y, z); return ret; } //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char1 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char1* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char2 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char2* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char4 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(char4* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned char *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned char* retVal, hipTextureObject_t textureObject, + float x, float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar1 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar1* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar2 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar2* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar4 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uchar4* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short1 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short1* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short2 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short2* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short4 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(short4* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned short *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned short* retVal, hipTextureObject_t textureObject, + float x, float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort1 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort1* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort2 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort2* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort4 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(ushort4* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int1 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int1* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int2 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int2* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int4 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(int4* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned int *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(unsigned int* retVal, hipTextureObject_t textureObject, + float x, float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint1 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint1* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint2 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint2* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint4 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(uint4* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float1 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float1* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float2 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float2* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float4 *retVal, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex3DLod(float4* retVal, hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_SET_FLOAT_XYZW; } template -__TEXTURE_FUNCTIONS_DECL__ T tex3DLod(hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ T tex3DLod(hipTextureObject_t textureObject, float x, float y, float z, + float level) { T ret; tex3DLod(&ret, textureObject, x, y, z, level); return ret; } //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char1 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char1* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char2 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char2* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char4 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(char4* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned char *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned char* retVal, + hipTextureObject_t textureObject, float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar1 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar1* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar2 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar2* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar4 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uchar4* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short1 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short1* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short2 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short2* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short4 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(short4* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned short *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned short* retVal, + hipTextureObject_t textureObject, float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort1 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort1* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort2 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort2* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort4 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(ushort4* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int* retVal, hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int1 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int1* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int2 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int2* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int4 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(int4* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned int *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(unsigned int* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint1 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint1* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint2 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint2* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint4 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(uint4* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float1 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float1* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float2 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float2* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float4 *retVal, hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayered(float4* retVal, hipTextureObject_t textureObject, + float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_SET_FLOAT_XYZW; } template -__TEXTURE_FUNCTIONS_DECL__ T tex1DLayered(hipTextureObject_t textureObject, float x, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ T tex1DLayered(hipTextureObject_t textureObject, float x, int layer) { T ret; tex1DLayered(&ret, textureObject, x, layer); return ret; } //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char1 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char1* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char2 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char2* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char4 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(char4* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned char *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned char* retVal, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar1 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar1* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar2 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar2* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar4 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uchar4* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short1 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short1* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short2 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short2* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short4 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(short4* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned short *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned short* retVal, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort1 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort1* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort2 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort2* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort4 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(ushort4* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int1 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int1* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int2 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int2* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int4 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(int4* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned int *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(unsigned int* retVal, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint1 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint1* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint2 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint2* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint4 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(uint4* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float1 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float1* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float2 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float2* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float4 *retVal, hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredLod(float4* retVal, hipTextureObject_t textureObject, + float x, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_SET_FLOAT_XYZW; } template -__TEXTURE_FUNCTIONS_DECL__ T tex1DLayeredLod(hipTextureObject_t textureObject, float x, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ T tex1DLayeredLod(hipTextureObject_t textureObject, float x, int layer, + float level) { T ret; tex1DLayeredLod(&ret, textureObject, x, layer, level); return ret; } //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char1 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char1* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char2 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char2* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char4 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(char4* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned char *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned char* retVal, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar1 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar1* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar2 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar2* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar4 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uchar4* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short1 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short1* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short2 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short2* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short4 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(short4* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned short *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned short* retVal, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort1 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort1* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort2 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort2* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort4 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(ushort4* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int1 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int1* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int2 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int2* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int4 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(int4* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned int *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(unsigned int* retVal, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint1 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint1* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint2 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint2* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint4 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(uint4* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float1 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float1* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float2 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float2* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float4 *retVal, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex1DLayeredGrad(float4* retVal, hipTextureObject_t textureObject, + float x, int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_SET_FLOAT_XYZW; } template -__TEXTURE_FUNCTIONS_DECL__ T tex1DLayeredGrad(hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +__TEXTURE_FUNCTIONS_DECL__ T tex1DLayeredGrad(hipTextureObject_t textureObject, float x, int layer, + float dx, float dy) { T ret; tex1DLayeredGrad(&ret, textureObject, x, layer, dx, dy); return ret; } //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(char4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned char *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned char* retVal, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uchar4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(short4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned short *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned short* retVal, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(ushort4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int* retVal, hipTextureObject_t textureObject, float x, + float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(int4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned int *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(unsigned int* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(uint4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayered(float4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_SET_FLOAT_XYZW; } template -__TEXTURE_FUNCTIONS_DECL__ T tex2DLayered(hipTextureObject_t textureObject, float x, float y, int layer) -{ +__TEXTURE_FUNCTIONS_DECL__ T tex2DLayered(hipTextureObject_t textureObject, float x, float y, + int layer) { T ret; tex2DLayered(&ret, textureObject, x, y, layer); return ret; } //////////////////////////////////////////////////////////// -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(char4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned char *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned char* retVal, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uchar4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(short4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned short *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned short* retVal, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(ushort4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_SIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_SIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_SIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(int4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_SIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned int *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(unsigned int* retVal, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_UNSIGNED; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_UNSIGNED_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_UNSIGNED_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(uint4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_UNSIGNED_XYZW; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_FLOAT; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float1 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float1* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_FLOAT_X; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float2 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float2* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_FLOAT_XY; } -__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float4 *retVal, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ void tex2DLayeredLod(float4* retVal, hipTextureObject_t textureObject, + float x, float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_SET_FLOAT_XYZW; } template -__TEXTURE_FUNCTIONS_DECL__ T tex2DLayeredLod(hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +__TEXTURE_FUNCTIONS_DECL__ T tex2DLayeredLod(hipTextureObject_t textureObject, float x, float y, + int layer, float level) { T ret; tex2DLayeredLod(&ret, textureObject, x, y, layer, level); return ret; @@ -2973,225 +3003,200 @@ __TEXTURE_FUNCTIONS_DECL__ T tex2DLayeredLod(hipTextureObject_t textureObject, f //////////////////////////////////////////////////////////// // Texture Reference APIs //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1Dfetch(texture texRef, + int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1Dfetch(texture texRef, + int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1Dfetch(texture texRef, + int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT_XYZW; @@ -3199,675 +3204,650 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture texR //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1D(texture texRef, + int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1D(texture texRef, + int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1D(texture texRef, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1D(texture texRef, int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1D(texture texRef, /*hipTextureObject_t textureObject,*/ int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1D(texture texRef, + /*hipTextureObject_t textureObject,*/ int x) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1D(texture texRef, hipTextureObject_t textureObject, int x) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1D(texture texRef, + hipTextureObject_t textureObject, int x) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1D(i, s, x); TEXTURE_RETURN_FLOAT_XYZW; @@ -3875,224 +3855,223 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1D(texture texRef, h //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLod(texture texRef, + float x, float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLod(texture texRef, + float x, float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DLod(texture texRef, float x, float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLod(texture texRef, + float x, float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLod(texture texRef, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLod(texture texRef, float x, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_FLOAT_XYZW; @@ -4100,224 +4079,230 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLod(texture texRef //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLod(texture texRef, + hipTextureObject_t textureObject, float x, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_1D(i, s, x, level); TEXTURE_RETURN_FLOAT_XYZW; @@ -4325,225 +4310,225 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLod(texture texRef //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DGrad(texture texRef, + float x, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DGrad(texture texRef, float x, + float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DGrad(texture texRef, float x, + float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DGrad(texture texRef, float x, + float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DGrad(texture texRef, float x, + float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DGrad(texture texRef, float x, + float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DGrad(texture texRef, float x, + float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DGrad(texture texRef, + float x, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DGrad(texture texRef, float x, + float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DGrad(texture texRef, float x, + float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DGrad(texture texRef, float x, + float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DGrad(texture texRef, + float x, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DGrad(texture texRef, float x, float dx, + float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DGrad(texture texRef, float x, + float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DGrad(texture texRef, float x, + float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DGrad(texture texRef, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DGrad(texture texRef, float x, + float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_FLOAT_XYZW; @@ -4551,225 +4536,253 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1DGrad(texture texRe //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float dx, float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float dx, + float dy) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); TEXTURE_RETURN_FLOAT_XYZW; @@ -4777,453 +4790,428 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1DGrad(texture texRe //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2D(texture texRef, + float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2D(texture texRef, + float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2D(texture texRef, float x, + float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UINT_XYZW; } - //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2D(texture texRef, + hipTextureObject_t textureObject, float x, + float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2D(texture texRef, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2D(texture texRef, float x, float y) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2D(texture texRef, + hipTextureObject_t textureObject, float x, float y) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; @@ -5231,225 +5219,225 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex2D(texture texRef, h //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_CHAR_XY; + TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLod(texture texRef, + float x, float y, float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_UCHAR_XY; + TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_SHORT_XY; + TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLod(texture texRef, + float x, float y, float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLod(texture texRef, float x, + float y, float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLod(texture texRef, float x, + float y, float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_USHORT_XY; + TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLod(texture texRef, float x, + float y, float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_INT_XY; + TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLod(texture texRef, + float x, float y, float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_UINT_XY; + TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_FLOAT_XY; + TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLod(texture texRef, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLod(texture texRef, float x, float y, + float level) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_FLOAT_XYZW; @@ -5457,225 +5445,253 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLod(texture texRef //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_CHAR_XY; + TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_UCHAR_XY; + TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_SHORT_XY; + TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_USHORT_XY; + TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_INT_XY; + TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_UINT_XY; + TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); - TEXTURE_RETURN_FLOAT_XY; + TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float level) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); TEXTURE_RETURN_FLOAT_XYZW; @@ -5683,845 +5699,817 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLod(texture texRef //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DGrad(texture texRef, + float x, float y, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DGrad(texture texRef, + float x, float y, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DGrad(texture texRef, float x, + float y, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DGrad(texture texRef, float x, + float y, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DGrad(texture texRef, float x, + float y, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DGrad(texture texRef, + float x, float y, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DGrad(texture texRef, float x, float y, + float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2D(i, s, - hc::short_vector::float2(x, y).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = __ockl_image_sample_grad_2D(i, s, hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3D(texture texRef, + float x, float y, float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3D(texture texRef, + float x, float y, float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3D(texture texRef, float x, + float y, float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex3D(texture texRef, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex3D(texture texRef, float x, float y, + float z) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; @@ -6529,225 +6517,248 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex3D(texture texRef, f //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex3D(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; @@ -6755,1168 +6766,1258 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex3D(texture texRef, h //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DLod(texture texRef, + float x, float y, float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DLod(texture texRef, + float x, float y, float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex3DLod(texture texRef, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex3DLod(texture texRef, float x, float y, + float z, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, float z, + float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex3DLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + level); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DGrad(texture texRef, + float x, float y, float z, float4 dx, + float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3DGrad(texture texRef, + float x, float y, float z, float4 dx, + float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3DGrad(texture texRef, float x, + float y, float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3DGrad(texture texRef, float x, + float y, float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3DGrad(texture texRef, float x, + float y, float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DGrad(texture texRef, + float x, float y, float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex3DGrad(texture texRef, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex3DGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + float z, float4 dx, float4 dy) { TEXTURE_PARAMETERS_INIT; - texel.f =__ockl_image_sample_grad_3D(i, s, - hc::short_vector::float4(x, y, z, 0.0f).get_vector(), - hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), - hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + texel.f = + __ockl_image_sample_grad_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayered(texture texRef, + float x, int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayered( + texture texRef, float x, int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayered(texture texRef, + float x, int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayered(texture texRef, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayered(texture texRef, float x, + int layer) { TEXTURE_REF_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; @@ -7924,225 +8025,248 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayered(texture te //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayered( + texture texRef, hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + int layer) { TEXTURE_PARAMETERS_INIT; texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; @@ -8150,2421 +8274,2788 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayered(texture te //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredLod( + texture texRef, float x, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredLod( + texture texRef, float x, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredLod(texture texRef, + float x, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredLod(texture texRef, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredLod(texture texRef, float x, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredLod( + texture texRef, hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredLod( + texture texRef, hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, int layer, + float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + texel.f = + __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredGrad( + texture texRef, float x, int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredGrad( + texture texRef, hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredGrad( + texture texRef, float x, int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredGrad( + texture texRef, hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredGrad( + texture texRef, float x, int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredGrad( + texture texRef, hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredGrad(texture texRef, float x, + int layer, float dx, float dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_FLOAT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + int layer, float dx, float dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + texel.f = + __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DLayered(texture texRef, float x, float y, + int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayered(texture texRef, + float x, float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayered( + texture texRef, float x, float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayered( + texture texRef, hipTextureObject_t textureObject, float x, + float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DLayered(texture texRef, float x, float y, + int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayered(texture texRef, float x, float y, + int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayered(texture texRef, float x, float y, + int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayered(texture texRef, float x, float y, + int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayered(texture texRef, + float x, float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayered(texture texRef, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayered(texture texRef, float x, + float y, int layer) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayered(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + texel.f = + __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredLod( + texture texRef, float x, float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredLod( + texture texRef, hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredLod( + texture texRef, float x, float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredLod( + texture texRef, hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredLod(texture texRef, float x, float y, + int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredLod(texture texRef, + float x, float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredLod(texture texRef, float x, + float y, int layer, float level) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_FLOAT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredLod(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float level) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + texel.f = __ockl_image_sample_lod_2Da( + i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); TEXTURE_RETURN_FLOAT_XYZW; } //////////////////////////////////////////////////////////// -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_CHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredGrad( + texture texRef, float x, float y, int layer, float2 dx, + float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredGrad( + texture texRef, hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UCHAR_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_SHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredGrad( + texture texRef, float x, float y, int layer, float2 dx, + float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredGrad( + texture texRef, hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_USHORT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, float y, + int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_INT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredGrad( + texture texRef, float x, float y, int layer, float2 dx, + float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredGrad( + texture texRef, hipTextureObject_t textureObject, float x, float y, + int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_UINT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT_X; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT_XY; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredGrad(texture texRef, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_REF_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; } -template -__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) -{ +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredGrad(texture texRef, + hipTextureObject_t textureObject, float x, + float y, int layer, float2 dx, float2 dy) { TEXTURE_PARAMETERS_INIT; - texel.f = __ockl_image_sample_grad_2Da(i, s, - hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), - hc::short_vector::float2(dx.x, dx.y).get_vector(), - hc::short_vector::float2(dy.x, dy.y).get_vector()); + texel.f = + __ockl_image_sample_grad_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); TEXTURE_RETURN_FLOAT_XYZW; } #endif diff --git a/hipamd/include/hip/hcc_detail/texture_types.h b/hipamd/include/hip/hcc_detail/texture_types.h index 0a99abe451..3d0d44bd55 100644 --- a/hipamd/include/hip/hcc_detail/texture_types.h +++ b/hipamd/include/hip/hcc_detail/texture_types.h @@ -24,15 +24,15 @@ THE SOFTWARE. #ifndef HIP_INCLUDE_HIP_HCC_DETAIL_TEXTURE_TYPES_H #define HIP_INCLUDE_HIP_HCC_DETAIL_TEXTURE_TYPES_H -#include +#include -#define hipTextureType1D 0x01 -#define hipTextureType2D 0x02 -#define hipTextureType3D 0x03 -#define hipTextureTypeCubemap 0x0C -#define hipTextureType1DLayered 0xF1 -#define hipTextureType2DLayered 0xF2 -#define hipTextureTypeCubemapLayered 0xFC +#define hipTextureType1D 0x01 +#define hipTextureType2D 0x02 +#define hipTextureType3D 0x03 +#define hipTextureTypeCubemap 0x0C +#define hipTextureType1DLayered 0xF1 +#define hipTextureType2DLayered 0xF2 +#define hipTextureTypeCubemapLayered 0xFC /** * Should be same as HSA_IMAGE_OBJECT_SIZE_DWORD/HSA_SAMPLER_OBJECT_SIZE_DWORD @@ -50,10 +50,9 @@ typedef unsigned long long hipTextureObject_t; /** * hip texture address modes */ -enum hipTextureAddressMode -{ - hipAddressModeWrap = 0, - hipAddressModeClamp = 1, +enum hipTextureAddressMode { + hipAddressModeWrap = 0, + hipAddressModeClamp = 1, hipAddressModeMirror = 2, hipAddressModeBorder = 3 }; @@ -61,58 +60,48 @@ enum hipTextureAddressMode /** * hip texture filter modes */ -enum hipTextureFilterMode -{ - hipFilterModePoint = 0, - hipFilterModeLinear = 1 -}; +enum hipTextureFilterMode { hipFilterModePoint = 0, hipFilterModeLinear = 1 }; /** * hip texture read modes */ -enum hipTextureReadMode -{ - hipReadModeElementType = 0, - hipReadModeNormalizedFloat = 1 -}; +enum hipTextureReadMode { hipReadModeElementType = 0, hipReadModeNormalizedFloat = 1 }; /** * hip texture reference */ -struct textureReference -{ - int normalized; - enum hipTextureFilterMode filterMode; - enum hipTextureAddressMode addressMode[3]; //Texture address mode for up to 3 dimensions +struct textureReference { + int normalized; + enum hipTextureFilterMode filterMode; + enum hipTextureAddressMode addressMode[3]; // Texture address mode for up to 3 dimensions struct hipChannelFormatDesc channelDesc; - int sRGB; // Perform sRGB->linear conversion during texture read - unsigned int maxAnisotropy; // Limit to the anisotropy ratio - enum hipTextureFilterMode mipmapFilterMode; - float mipmapLevelBias; - float minMipmapLevelClamp; - float maxMipmapLevelClamp; + int sRGB; // Perform sRGB->linear conversion during texture read + unsigned int maxAnisotropy; // Limit to the anisotropy ratio + enum hipTextureFilterMode mipmapFilterMode; + float mipmapLevelBias; + float minMipmapLevelClamp; + float maxMipmapLevelClamp; - hipTextureObject_t textureObject; - int numChannels; - enum hipArray_Format format; + hipTextureObject_t textureObject; + int numChannels; + enum hipArray_Format format; }; /** * hip texture descriptor */ -struct hipTextureDesc -{ - enum hipTextureAddressMode addressMode[3]; //Texture address mode for up to 3 dimensions - enum hipTextureFilterMode filterMode; - enum hipTextureReadMode readMode; - int sRGB; // Perform sRGB->linear conversion during texture read - float borderColor[4]; - int normalizedCoords; - unsigned int maxAnisotropy; - enum hipTextureFilterMode mipmapFilterMode; - float mipmapLevelBias; - float minMipmapLevelClamp; - float maxMipmapLevelClamp; +struct hipTextureDesc { + enum hipTextureAddressMode addressMode[3]; // Texture address mode for up to 3 dimensions + enum hipTextureFilterMode filterMode; + enum hipTextureReadMode readMode; + int sRGB; // Perform sRGB->linear conversion during texture read + float borderColor[4]; + int normalizedCoords; + unsigned int maxAnisotropy; + enum hipTextureFilterMode mipmapFilterMode; + float mipmapLevelBias; + float minMipmapLevelClamp; + float maxMipmapLevelClamp; }; #endif diff --git a/hipamd/include/hip/hip_common.h b/hipamd/include/hip/hip_common.h index d884a23c5f..71285fc8dc 100644 --- a/hipamd/include/hip/hip_common.h +++ b/hipamd/include/hip/hip_common.h @@ -28,7 +28,7 @@ THE SOFTWARE. // Other compiler (GCC,ICC,etc) need to set one of these macros explicitly #if defined(__HCC__) || (defined(__clang__) && defined(__HIP__)) #define __HIP_PLATFORM_HCC__ -#endif //__HCC__ +#endif //__HCC__ // Auto enable __HIP_PLATFORM_NVCC__ if compiling with NVCC #if defined(__NVCC__) || (defined(__clang__) && defined(__CUDA__) && !defined(__HIP__)) @@ -37,42 +37,43 @@ THE SOFTWARE. #define __HIPCC__ #endif -#endif //__NVCC__ +#endif //__NVCC__ // Auto enable __HIP_DEVICE_COMPILE__ if compiled in HCC or NVCC device path -#if (defined(__HCC_ACCELERATOR__) && __HCC_ACCELERATOR__ != 0) || (defined(__CUDA_ARCH__) && __CUDA_ARCH__ != 0) - #define __HIP_DEVICE_COMPILE__ 1 +#if (defined(__HCC_ACCELERATOR__) && __HCC_ACCELERATOR__ != 0) || \ + (defined(__CUDA_ARCH__) && __CUDA_ARCH__ != 0) +#define __HIP_DEVICE_COMPILE__ 1 #endif #if __HIP_DEVICE_COMPILE__ == 0 // 32-bit Atomics -#define __HIP_ARCH_HAS_GLOBAL_INT32_ATOMICS__ (0) -#define __HIP_ARCH_HAS_GLOBAL_FLOAT_ATOMIC_EXCH__ (0) -#define __HIP_ARCH_HAS_SHARED_INT32_ATOMICS__ (0) -#define __HIP_ARCH_HAS_SHARED_FLOAT_ATOMIC_EXCH__ (0) -#define __HIP_ARCH_HAS_FLOAT_ATOMIC_ADD__ (0) +#define __HIP_ARCH_HAS_GLOBAL_INT32_ATOMICS__ (0) +#define __HIP_ARCH_HAS_GLOBAL_FLOAT_ATOMIC_EXCH__ (0) +#define __HIP_ARCH_HAS_SHARED_INT32_ATOMICS__ (0) +#define __HIP_ARCH_HAS_SHARED_FLOAT_ATOMIC_EXCH__ (0) +#define __HIP_ARCH_HAS_FLOAT_ATOMIC_ADD__ (0) // 64-bit Atomics -#define __HIP_ARCH_HAS_GLOBAL_INT64_ATOMICS__ (0) -#define __HIP_ARCH_HAS_SHARED_INT64_ATOMICS__ (0) +#define __HIP_ARCH_HAS_GLOBAL_INT64_ATOMICS__ (0) +#define __HIP_ARCH_HAS_SHARED_INT64_ATOMICS__ (0) // Doubles -#define __HIP_ARCH_HAS_DOUBLES__ (0) +#define __HIP_ARCH_HAS_DOUBLES__ (0) // Warp cross-lane operations -#define __HIP_ARCH_HAS_WARP_VOTE__ (0) -#define __HIP_ARCH_HAS_WARP_BALLOT__ (0) -#define __HIP_ARCH_HAS_WARP_SHUFFLE__ (0) -#define __HIP_ARCH_HAS_WARP_FUNNEL_SHIFT__ (0) +#define __HIP_ARCH_HAS_WARP_VOTE__ (0) +#define __HIP_ARCH_HAS_WARP_BALLOT__ (0) +#define __HIP_ARCH_HAS_WARP_SHUFFLE__ (0) +#define __HIP_ARCH_HAS_WARP_FUNNEL_SHIFT__ (0) // Sync -#define __HIP_ARCH_HAS_THREAD_FENCE_SYSTEM__ (0) -#define __HIP_ARCH_HAS_SYNC_THREAD_EXT__ (0) +#define __HIP_ARCH_HAS_THREAD_FENCE_SYSTEM__ (0) +#define __HIP_ARCH_HAS_SYNC_THREAD_EXT__ (0) // Misc -#define __HIP_ARCH_HAS_SURFACE_FUNCS__ (0) -#define __HIP_ARCH_HAS_3DGRID__ (0) -#define __HIP_ARCH_HAS_DYNAMIC_PARALLEL__ (0) +#define __HIP_ARCH_HAS_SURFACE_FUNCS__ (0) +#define __HIP_ARCH_HAS_3DGRID__ (0) +#define __HIP_ARCH_HAS_DYNAMIC_PARALLEL__ (0) #endif #endif diff --git a/hipamd/include/hip/hip_complex.h b/hipamd/include/hip/hip_complex.h index dc691be480..fb9cad5e48 100644 --- a/hipamd/include/hip/hip_complex.h +++ b/hipamd/include/hip/hip_complex.h @@ -25,9 +25,9 @@ THE SOFTWARE. #include -#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__) +#if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_PLATFORM_NVCC__) #include -#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__) +#elif defined(__HIP_PLATFORM_NVCC__) && !defined(__HIP_PLATFORM_HCC__) #include #else #error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); diff --git a/hipamd/include/hip/hip_fp16.h b/hipamd/include/hip/hip_fp16.h index 95879dba50..994ce62bd8 100644 --- a/hipamd/include/hip/hip_fp16.h +++ b/hipamd/include/hip/hip_fp16.h @@ -25,9 +25,9 @@ THE SOFTWARE. #include -#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__) +#if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_PLATFORM_NVCC__) #include -#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__) +#elif defined(__HIP_PLATFORM_NVCC__) && !defined(__HIP_PLATFORM_HCC__) #include "cuda_fp16.h" #else #error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); diff --git a/hipamd/include/hip/hip_hcc.h b/hipamd/include/hip/hip_hcc.h index 582d544eb9..c07a57fb3a 100644 --- a/hipamd/include/hip/hip_hcc.h +++ b/hipamd/include/hip/hip_hcc.h @@ -29,16 +29,17 @@ THE SOFTWARE. // Forward declarations: namespace hc { - class accelerator; - class accelerator_view; -}; +class accelerator; +class accelerator_view; +}; // namespace hc /** *------------------------------------------------------------------------------------------------- *------------------------------------------------------------------------------------------------- * @defgroup HCC-specific features - * @warning These APIs provide access to special features of HCC compiler and are not available through the CUDA path. + * @warning These APIs provide access to special features of HCC compiler and are not available + *through the CUDA path. * @{ */ @@ -47,7 +48,7 @@ namespace hc { * @brief Return hc::accelerator associated with the specified deviceId * @return #hipSuccess, #hipErrorInvalidDevice */ -hipError_t hipHccGetAccelerator(int deviceId, hc::accelerator *acc); +hipError_t hipHccGetAccelerator(int deviceId, hc::accelerator* acc); /** * @brief Return hc::accelerator_view associated with the specified stream @@ -55,12 +56,12 @@ hipError_t hipHccGetAccelerator(int deviceId, hc::accelerator *acc); * If stream is 0, the accelerator_view for the default stream is returned. * @return #hipSuccess */ -hipError_t hipHccGetAcceleratorView(hipStream_t stream, hc::accelerator_view **av); - +hipError_t hipHccGetAcceleratorView(hipStream_t stream, hc::accelerator_view** av); /** - * @brief launches kernel f with launch parameters and shared memory on stream with arguments passed to kernelparams or extra + * @brief launches kernel f with launch parameters and shared memory on stream with arguments passed + to kernelparams or extra * * @param [in[ f Kernel to launch. * @param [in] gridDimX X grid dimension specified in work-items @@ -69,37 +70,36 @@ hipError_t hipHccGetAcceleratorView(hipStream_t stream, hc::accelerator_view **a * @param [in] blockDimX X block dimensions specified in work-items * @param [in] blockDimY Y grid dimension specified in work-items * @param [in] blockDimZ Z grid dimension specified in work-items - * @param [in] sharedMemBytes Amount of dynamic shared memory to allocate for this kernel. The kernel can access this with HIP_DYNAMIC_SHARED. - * @param [in] stream Stream where the kernel should be dispatched. May be 0, in which case th default stream is used with associated synchronization rules. - * @param [in] kernelParams - * @param [in] extra Pointer to kernel arguments. These are passed directly to the kernel and must be in the memory layout and alignment expected by the kernel. - * @param [in] startEvent If non-null, specified event will be updated to track the start time of the kernel launch. The event must be created before calling this API. - * @param [in] stopEvent If non-null, specified event will be updated to track the stop time of the kernel launch. The event must be created before calling this API. + * @param [in] sharedMemBytes Amount of dynamic shared memory to allocate for this kernel. The + kernel can access this with HIP_DYNAMIC_SHARED. + * @param [in] stream Stream where the kernel should be dispatched. May be 0, in which case th + default stream is used with associated synchronization rules. + * @param [in] kernelParams + * @param [in] extra Pointer to kernel arguments. These are passed directly to the kernel and + must be in the memory layout and alignment expected by the kernel. + * @param [in] startEvent If non-null, specified event will be updated to track the start time of + the kernel launch. The event must be created before calling this API. + * @param [in] stopEvent If non-null, specified event will be updated to track the stop time of + the kernel launch. The event must be created before calling this API. * * @returns hipSuccess, hipInvalidDevice, hipErrorNotInitialized, hipErrorInvalidValue - * - * @warning kernellParams argument is not yet implemented in HIP. Please use extra instead. Please refer to hip_porting_driver_api.md for sample usage. + * + * @warning kernellParams argument is not yet implemented in HIP. Please use extra instead. Please + refer to hip_porting_driver_api.md for sample usage. * HIP/ROCm actually updates the start event when the associated kernel completes. */ -hipError_t hipHccModuleLaunchKernel(hipFunction_t f, - uint32_t globalWorkSizeX, - uint32_t globalWorkSizeY, - uint32_t globalWorkSizeZ, - uint32_t localWorkSizeX, - uint32_t localWorkSizeY, - uint32_t localWorkSizeZ, - size_t sharedMemBytes, - hipStream_t hStream, - void **kernelParams, - void **extra, - hipEvent_t startEvent=nullptr, - hipEvent_t stopEvent=nullptr - ); +hipError_t hipHccModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX, + uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ, + uint32_t localWorkSizeX, uint32_t localWorkSizeY, + uint32_t localWorkSizeZ, size_t sharedMemBytes, + hipStream_t hStream, void** kernelParams, void** extra, + hipEvent_t startEvent = nullptr, + hipEvent_t stopEvent = nullptr); // doxygen end HCC-specific features /** * @} */ -#endif // #ifdef __HCC__ -#endif // #ifdef HIP_INCLUDE_HIP_HIP_HCC_H +#endif // #ifdef __HCC__ +#endif // #ifdef HIP_INCLUDE_HIP_HIP_HCC_H diff --git a/hipamd/include/hip/hip_profile.h b/hipamd/include/hip/hip_profile.h index 389f334c74..7474839258 100644 --- a/hipamd/include/hip/hip_profile.h +++ b/hipamd/include/hip/hip_profile.h @@ -23,13 +23,14 @@ THE SOFTWARE. #ifndef HIP_INCLUDE_HIP_HIP_PROFILE_H #define HIP_INCLUDE_HIP_HIP_PROFILE_H -#if not defined (ENABLE_HIP_PROFILE) +#if not defined(ENABLE_HIP_PROFILE) #define ENABLE_HIP_PROFILE 1 #endif -#if defined(__HIP_PLATFORM_HCC__) and (ENABLE_HIP_PROFILE==1) +#if defined(__HIP_PLATFORM_HCC__) and (ENABLE_HIP_PROFILE == 1) #include -#define HIP_SCOPED_MARKER(markerName, group) amdtScopedMarker __scopedMarker(markerName, group, nullptr); +#define HIP_SCOPED_MARKER(markerName, group) \ + amdtScopedMarker __scopedMarker(markerName, group, nullptr); #define HIP_BEGIN_MARKER(markerName, group) amdtBeginMarker(markerName, group, nullptr); #define HIP_END_MARKER() amdtEndMarker(); #else diff --git a/hipamd/include/hip/hip_runtime.h b/hipamd/include/hip/hip_runtime.h index fba4d46d8f..157fc88a43 100644 --- a/hipamd/include/hip/hip_runtime.h +++ b/hipamd/include/hip/hip_runtime.h @@ -30,8 +30,9 @@ THE SOFTWARE. //! Runtime API is C //! Memory management is based on pure pointers and resembles malloc/free/copy. // -//! hip_runtime.h : includes everything in hip_api.h, plus math builtins and kernel launch macros. -//! hip_runtime_api.h : Defines HIP API. This is a C header file and does not use any C++ features. +//! hip_runtime.h : includes everything in hip_api.h, plus math builtins and kernel launch +//! macros. hip_runtime_api.h : Defines HIP API. This is a C header file and does not use any C++ +//! features. #ifndef HIP_INCLUDE_HIP_HIP_RUNTIME_H #define HIP_INCLUDE_HIP_HIP_RUNTIME_H @@ -51,9 +52,9 @@ THE SOFTWARE. #include -#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__) +#if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_PLATFORM_NVCC__) #include -#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__) +#elif defined(__HIP_PLATFORM_NVCC__) && !defined(__HIP_PLATFORM_HCC__) #include #else #error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); diff --git a/hipamd/include/hip/hip_runtime_api.h b/hipamd/include/hip/hip_runtime_api.h index f764599164..8d27724ad6 100644 --- a/hipamd/include/hip/hip_runtime_api.h +++ b/hipamd/include/hip/hip_runtime_api.h @@ -31,45 +31,45 @@ THE SOFTWARE. #define HIP_INCLUDE_HIP_HIP_RUNTIME_API_H -#include // for getDeviceProp +#include // for getDeviceProp #include enum { -HIP_SUCCESS = 0, -HIP_ERROR_INVALID_VALUE, -HIP_ERROR_NOT_INITIALIZED, -HIP_ERROR_LAUNCH_OUT_OF_RESOURCES + HIP_SUCCESS = 0, + HIP_ERROR_INVALID_VALUE, + HIP_ERROR_NOT_INITIALIZED, + HIP_ERROR_LAUNCH_OUT_OF_RESOURCES }; typedef struct { // 32-bit Atomics - unsigned hasGlobalInt32Atomics : 1; ///< 32-bit integer atomics for global memory. - unsigned hasGlobalFloatAtomicExch : 1; ///< 32-bit float atomic exch for global memory. - unsigned hasSharedInt32Atomics : 1; ///< 32-bit integer atomics for shared memory. - unsigned hasSharedFloatAtomicExch : 1; ///< 32-bit float atomic exch for shared memory. - unsigned hasFloatAtomicAdd : 1; ///< 32-bit float atomic add in global and shared memory. + unsigned hasGlobalInt32Atomics : 1; ///< 32-bit integer atomics for global memory. + unsigned hasGlobalFloatAtomicExch : 1; ///< 32-bit float atomic exch for global memory. + unsigned hasSharedInt32Atomics : 1; ///< 32-bit integer atomics for shared memory. + unsigned hasSharedFloatAtomicExch : 1; ///< 32-bit float atomic exch for shared memory. + unsigned hasFloatAtomicAdd : 1; ///< 32-bit float atomic add in global and shared memory. // 64-bit Atomics - unsigned hasGlobalInt64Atomics : 1; ///< 64-bit integer atomics for global memory. - unsigned hasSharedInt64Atomics : 1; ///< 64-bit integer atomics for shared memory. + unsigned hasGlobalInt64Atomics : 1; ///< 64-bit integer atomics for global memory. + unsigned hasSharedInt64Atomics : 1; ///< 64-bit integer atomics for shared memory. // Doubles - unsigned hasDoubles : 1; ///< Double-precision floating point. + unsigned hasDoubles : 1; ///< Double-precision floating point. // Warp cross-lane operations - unsigned hasWarpVote : 1; ///< Warp vote instructions (__any, __all). - unsigned hasWarpBallot : 1; ///< Warp ballot instructions (__ballot). - unsigned hasWarpShuffle : 1; ///< Warp shuffle operations. (__shfl_*). - unsigned hasFunnelShift : 1; ///< Funnel two words into one with shift&mask caps. + unsigned hasWarpVote : 1; ///< Warp vote instructions (__any, __all). + unsigned hasWarpBallot : 1; ///< Warp ballot instructions (__ballot). + unsigned hasWarpShuffle : 1; ///< Warp shuffle operations. (__shfl_*). + unsigned hasFunnelShift : 1; ///< Funnel two words into one with shift&mask caps. // Sync - unsigned hasThreadFenceSystem : 1; ///< __threadfence_system. - unsigned hasSyncThreadsExt : 1; ///< __syncthreads_count, syncthreads_and, syncthreads_or. + unsigned hasThreadFenceSystem : 1; ///< __threadfence_system. + unsigned hasSyncThreadsExt : 1; ///< __syncthreads_count, syncthreads_and, syncthreads_or. // Misc - unsigned hasSurfaceFuncs : 1; ///< Surface functions. - unsigned has3dGrid : 1; ///< Grid and group dims are 3D (rather than 2D). - unsigned hasDynamicParallelism : 1; ///< Dynamic parallelism. + unsigned hasSurfaceFuncs : 1; ///< Surface functions. + unsigned has3dGrid : 1; ///< Grid and group dims are 3D (rather than 2D). + unsigned hasDynamicParallelism : 1; ///< Dynamic parallelism. } hipDeviceArch_t; @@ -81,35 +81,40 @@ typedef struct { * */ typedef struct hipDeviceProp_t { - char name[256]; ///< Device name. - size_t totalGlobalMem; ///< Size of global memory region (in bytes). - size_t sharedMemPerBlock; ///< Size of shared memory region (in bytes). - int regsPerBlock; ///< Registers per block. - int warpSize; ///< Warp size. - int maxThreadsPerBlock; ///< Max work items per work group or workgroup max size. - int maxThreadsDim[3]; ///< Max number of threads in each dimension (XYZ) of a block. - int maxGridSize[3]; ///< Max grid dimensions (XYZ). - int clockRate; ///< Max clock frequency of the multiProcessors in khz. - int memoryClockRate; ///< Max global memory clock frequency in khz. - int memoryBusWidth; ///< Global memory bus width in bits. - size_t totalConstMem; ///< Size of shared memory region (in bytes). - int major; ///< Major compute capability. On HCC, this is an approximation and features may differ from CUDA CC. See the arch feature flags for portable ways to query feature caps. - int minor; ///< Minor compute capability. On HCC, this is an approximation and features may differ from CUDA CC. See the arch feature flags for portable ways to query feature caps. - int multiProcessorCount; ///< Number of multi-processors (compute units). - int l2CacheSize; ///< L2 cache size. - int maxThreadsPerMultiProcessor; ///< Maximum resident threads per multi-processor. - int computeMode; ///< Compute mode. - int clockInstructionRate; ///< Frequency in khz of the timer used by the device-side "clock*" instructions. New for HIP. - hipDeviceArch_t arch; ///< Architectural feature flags. New for HIP. - int concurrentKernels; ///< Device can possibly execute multiple kernels concurrently. - int pciDomainID; ///< PCI Domain ID - int pciBusID; ///< PCI Bus ID. - int pciDeviceID; ///< PCI Device ID. - size_t maxSharedMemoryPerMultiProcessor; ///< Maximum Shared Memory Per Multiprocessor. - int isMultiGpuBoard; ///< 1 if device is on a multi-GPU board, 0 if not. - int canMapHostMemory; ///< Check whether HIP can map host memory - int gcnArch; ///< AMD GCN Arch Value. Eg: 803, 701 - } hipDeviceProp_t; + char name[256]; ///< Device name. + size_t totalGlobalMem; ///< Size of global memory region (in bytes). + size_t sharedMemPerBlock; ///< Size of shared memory region (in bytes). + int regsPerBlock; ///< Registers per block. + int warpSize; ///< Warp size. + int maxThreadsPerBlock; ///< Max work items per work group or workgroup max size. + int maxThreadsDim[3]; ///< Max number of threads in each dimension (XYZ) of a block. + int maxGridSize[3]; ///< Max grid dimensions (XYZ). + int clockRate; ///< Max clock frequency of the multiProcessors in khz. + int memoryClockRate; ///< Max global memory clock frequency in khz. + int memoryBusWidth; ///< Global memory bus width in bits. + size_t totalConstMem; ///< Size of shared memory region (in bytes). + int major; ///< Major compute capability. On HCC, this is an approximation and features may + ///< differ from CUDA CC. See the arch feature flags for portable ways to query + ///< feature caps. + int minor; ///< Minor compute capability. On HCC, this is an approximation and features may + ///< differ from CUDA CC. See the arch feature flags for portable ways to query + ///< feature caps. + int multiProcessorCount; ///< Number of multi-processors (compute units). + int l2CacheSize; ///< L2 cache size. + int maxThreadsPerMultiProcessor; ///< Maximum resident threads per multi-processor. + int computeMode; ///< Compute mode. + int clockInstructionRate; ///< Frequency in khz of the timer used by the device-side "clock*" + ///< instructions. New for HIP. + hipDeviceArch_t arch; ///< Architectural feature flags. New for HIP. + int concurrentKernels; ///< Device can possibly execute multiple kernels concurrently. + int pciDomainID; ///< PCI Domain ID + int pciBusID; ///< PCI Bus ID. + int pciDeviceID; ///< PCI Device ID. + size_t maxSharedMemoryPerMultiProcessor; ///< Maximum Shared Memory Per Multiprocessor. + int isMultiGpuBoard; ///< 1 if device is on a multi-GPU board, 0 if not. + int canMapHostMemory; ///< Check whether HIP can map host memory + int gcnArch; ///< AMD GCN Arch Value. Eg: 803, 701 +} hipDeviceProp_t; /** @@ -117,21 +122,22 @@ typedef struct hipDeviceProp_t { */ enum hipMemoryType { hipMemoryTypeHost, ///< Memory is physically located on host - hipMemoryTypeDevice, ///< Memory is physically located on device. (see deviceId for specific device) - hipMemoryTypeArray, ///< Array memory, physically located on device. (see deviceId for specific device) + hipMemoryTypeDevice, ///< Memory is physically located on device. (see deviceId for specific + ///< device) + hipMemoryTypeArray, ///< Array memory, physically located on device. (see deviceId for specific + ///< device) hipMemoryTypeUnified ///< Not used currently }; - /** * Pointer attributes */ typedef struct hipPointerAttribute_t { enum hipMemoryType memoryType; int device; - void *devicePointer; - void *hostPointer; + void* devicePointer; + void* hostPointer; int isManaged; unsigned allocationFlags; /* flags specified when memory was allocated*/ /* peers? */ @@ -158,74 +164,86 @@ typedef struct hipPointerAttribute_t { * @enum * @ingroup Enumerations */ -// Developer note - when updating these, update the hipErrorName and hipErrorString functions in NVCC and HCC paths -// Also update the hipCUDAErrorTohipError function in NVCC path. +// Developer note - when updating these, update the hipErrorName and hipErrorString functions in +// NVCC and HCC paths Also update the hipCUDAErrorTohipError function in NVCC path. typedef enum __HIP_NODISCARD hipError_t { - hipSuccess = 0, ///< Successful completion. - hipErrorOutOfMemory = 2, - hipErrorNotInitialized = 3, - hipErrorDeinitialized = 4, - hipErrorProfilerDisabled = 5, - hipErrorProfilerNotInitialized = 6, - hipErrorProfilerAlreadyStarted = 7, - hipErrorProfilerAlreadyStopped = 8, - hipErrorInsufficientDriver = 35, - hipErrorInvalidImage = 200, - hipErrorInvalidContext = 201, ///< Produced when input context is invalid. - hipErrorContextAlreadyCurrent = 202, - hipErrorMapFailed = 205, - hipErrorUnmapFailed = 206, - hipErrorArrayIsMapped = 207, - hipErrorAlreadyMapped = 208, - hipErrorNoBinaryForGpu = 209, - hipErrorAlreadyAcquired = 210, - hipErrorNotMapped = 211, - hipErrorNotMappedAsArray = 212, - hipErrorNotMappedAsPointer = 213, - hipErrorECCNotCorrectable = 214, - hipErrorUnsupportedLimit = 215, - hipErrorContextAlreadyInUse = 216, - hipErrorPeerAccessUnsupported = 217, - hipErrorInvalidKernelFile = 218, ///< In CUDA DRV, it is CUDA_ERROR_INVALID_PTX - hipErrorInvalidGraphicsContext = 219, - hipErrorInvalidSource = 300, - hipErrorFileNotFound = 301, + hipSuccess = 0, ///< Successful completion. + hipErrorOutOfMemory = 2, + hipErrorNotInitialized = 3, + hipErrorDeinitialized = 4, + hipErrorProfilerDisabled = 5, + hipErrorProfilerNotInitialized = 6, + hipErrorProfilerAlreadyStarted = 7, + hipErrorProfilerAlreadyStopped = 8, + hipErrorInsufficientDriver = 35, + hipErrorInvalidImage = 200, + hipErrorInvalidContext = 201, ///< Produced when input context is invalid. + hipErrorContextAlreadyCurrent = 202, + hipErrorMapFailed = 205, + hipErrorUnmapFailed = 206, + hipErrorArrayIsMapped = 207, + hipErrorAlreadyMapped = 208, + hipErrorNoBinaryForGpu = 209, + hipErrorAlreadyAcquired = 210, + hipErrorNotMapped = 211, + hipErrorNotMappedAsArray = 212, + hipErrorNotMappedAsPointer = 213, + hipErrorECCNotCorrectable = 214, + hipErrorUnsupportedLimit = 215, + hipErrorContextAlreadyInUse = 216, + hipErrorPeerAccessUnsupported = 217, + hipErrorInvalidKernelFile = 218, ///< In CUDA DRV, it is CUDA_ERROR_INVALID_PTX + hipErrorInvalidGraphicsContext = 219, + hipErrorInvalidSource = 300, + hipErrorFileNotFound = 301, hipErrorSharedObjectSymbolNotFound = 302, - hipErrorSharedObjectInitFailed = 303, - hipErrorOperatingSystem = 304, - hipErrorSetOnActiveProcess = 305, - hipErrorInvalidHandle = 400, - hipErrorNotFound = 500, - hipErrorIllegalAddress = 700, - hipErrorInvalidSymbol = 701, -// Runtime Error Codes start here. - hipErrorMissingConfiguration = 1001, - hipErrorMemoryAllocation = 1002, ///< Memory allocation error. - hipErrorInitializationError = 1003, ///< TODO comment from hipErrorInitializationError - hipErrorLaunchFailure = 1004, ///< An exception occurred on the device while executing a kernel. - hipErrorPriorLaunchFailure = 1005, - hipErrorLaunchTimeOut = 1006, - hipErrorLaunchOutOfResources = 1007, ///< Out of resources error. - hipErrorInvalidDeviceFunction = 1008, - hipErrorInvalidConfiguration = 1009, - hipErrorInvalidDevice = 1010, ///< DeviceID must be in range 0...#compute-devices. - hipErrorInvalidValue = 1011, ///< One or more of the parameters passed to the API call is NULL or not in an acceptable range. - hipErrorInvalidDevicePointer = 1017, ///< Invalid Device Pointer - hipErrorInvalidMemcpyDirection = 1021, ///< Invalid memory copy direction - hipErrorUnknown = 1030, ///< Unknown error. - hipErrorInvalidResourceHandle = 1033, ///< Resource handle (hipEvent_t or hipStream_t) invalid. - hipErrorNotReady = 1034, ///< Indicates that asynchronous operations enqueued earlier are not ready. This is not actually an error, but is used to distinguish from hipSuccess (which indicates completion). APIs that return this error include hipEventQuery and hipStreamQuery. - hipErrorNoDevice = 1038, ///< Call to hipGetDeviceCount returned 0 devices - hipErrorPeerAccessAlreadyEnabled = 1050, ///< Peer access was already enabled from the current device. + hipErrorSharedObjectInitFailed = 303, + hipErrorOperatingSystem = 304, + hipErrorSetOnActiveProcess = 305, + hipErrorInvalidHandle = 400, + hipErrorNotFound = 500, + hipErrorIllegalAddress = 700, + hipErrorInvalidSymbol = 701, + // Runtime Error Codes start here. + hipErrorMissingConfiguration = 1001, + hipErrorMemoryAllocation = 1002, ///< Memory allocation error. + hipErrorInitializationError = 1003, ///< TODO comment from hipErrorInitializationError + hipErrorLaunchFailure = + 1004, ///< An exception occurred on the device while executing a kernel. + hipErrorPriorLaunchFailure = 1005, + hipErrorLaunchTimeOut = 1006, + hipErrorLaunchOutOfResources = 1007, ///< Out of resources error. + hipErrorInvalidDeviceFunction = 1008, + hipErrorInvalidConfiguration = 1009, + hipErrorInvalidDevice = 1010, ///< DeviceID must be in range 0...#compute-devices. + hipErrorInvalidValue = 1011, ///< One or more of the parameters passed to the API call is NULL + ///< or not in an acceptable range. + hipErrorInvalidDevicePointer = 1017, ///< Invalid Device Pointer + hipErrorInvalidMemcpyDirection = 1021, ///< Invalid memory copy direction + hipErrorUnknown = 1030, ///< Unknown error. + hipErrorInvalidResourceHandle = 1033, ///< Resource handle (hipEvent_t or hipStream_t) invalid. + hipErrorNotReady = 1034, ///< Indicates that asynchronous operations enqueued earlier are not + ///< ready. This is not actually an error, but is used to distinguish + ///< from hipSuccess (which indicates completion). APIs that return + ///< this error include hipEventQuery and hipStreamQuery. + hipErrorNoDevice = 1038, ///< Call to hipGetDeviceCount returned 0 devices + hipErrorPeerAccessAlreadyEnabled = + 1050, ///< Peer access was already enabled from the current device. - hipErrorPeerAccessNotEnabled = 1051, ///< Peer access was never enabled from the current device. - hipErrorRuntimeMemory = 1052, ///< HSA runtime memory call returned error. Typically not seen in production systems. - hipErrorRuntimeOther = 1053, ///< HSA runtime call other than memory returned error. Typically not seen in production systems. - hipErrorHostMemoryAlreadyRegistered = 1061, ///< Produced when trying to lock a page-locked memory. - hipErrorHostMemoryNotRegistered = 1062, ///< Produced when trying to unlock a non-page-locked memory. - hipErrorMapBufferObjectFailed = 1071, ///< Produced when the IPC memory attach failed from ROCr. - hipErrorTbd ///< Marker that more error codes are needed. + hipErrorPeerAccessNotEnabled = + 1051, ///< Peer access was never enabled from the current device. + hipErrorRuntimeMemory = 1052, ///< HSA runtime memory call returned error. Typically not seen + ///< in production systems. + hipErrorRuntimeOther = 1053, ///< HSA runtime call other than memory returned error. Typically + ///< not seen in production systems. + hipErrorHostMemoryAlreadyRegistered = + 1061, ///< Produced when trying to lock a page-locked memory. + hipErrorHostMemoryNotRegistered = + 1062, ///< Produced when trying to unlock a non-page-locked memory. + hipErrorMapBufferObjectFailed = + 1071, ///< Produced when the IPC memory attach failed from ROCr. + hipErrorTbd ///< Marker that more error codes are needed. } hipError_t; #undef __HIP_NODISCARD @@ -236,31 +254,39 @@ typedef enum __HIP_NODISCARD hipError_t { * @ingroup Enumerations */ typedef enum hipDeviceAttribute_t { - hipDeviceAttributeMaxThreadsPerBlock, ///< Maximum number of threads per block. - hipDeviceAttributeMaxBlockDimX, ///< Maximum x-dimension of a block. - hipDeviceAttributeMaxBlockDimY, ///< Maximum y-dimension of a block. - hipDeviceAttributeMaxBlockDimZ, ///< Maximum z-dimension of a block. - hipDeviceAttributeMaxGridDimX, ///< Maximum x-dimension of a grid. - hipDeviceAttributeMaxGridDimY, ///< Maximum y-dimension of a grid. - hipDeviceAttributeMaxGridDimZ, ///< Maximum z-dimension of a grid. - hipDeviceAttributeMaxSharedMemoryPerBlock, ///< Maximum shared memory available per block in bytes. - hipDeviceAttributeTotalConstantMemory, ///< Constant memory size in bytes. - hipDeviceAttributeWarpSize, ///< Warp size in threads. - hipDeviceAttributeMaxRegistersPerBlock, ///< Maximum number of 32-bit registers available to a thread block. This number is shared by all thread blocks simultaneously resident on a multiprocessor. - hipDeviceAttributeClockRate, ///< Peak clock frequency in kilohertz. - hipDeviceAttributeMemoryClockRate, ///< Peak memory clock frequency in kilohertz. - hipDeviceAttributeMemoryBusWidth, ///< Global memory bus width in bits. - hipDeviceAttributeMultiprocessorCount, ///< Number of multiprocessors on the device. - hipDeviceAttributeComputeMode, ///< Compute mode that device is currently in. - hipDeviceAttributeL2CacheSize, ///< Size of L2 cache in bytes. 0 if the device doesn't have L2 cache. - hipDeviceAttributeMaxThreadsPerMultiProcessor, ///< Maximum resident threads per multiprocessor. - hipDeviceAttributeComputeCapabilityMajor, ///< Major compute capability version number. - hipDeviceAttributeComputeCapabilityMinor, ///< Minor compute capability version number. - hipDeviceAttributeConcurrentKernels, ///< Device can possibly execute multiple kernels concurrently. - hipDeviceAttributePciBusId, ///< PCI Bus ID. - hipDeviceAttributePciDeviceId, ///< PCI Device ID. - hipDeviceAttributeMaxSharedMemoryPerMultiprocessor, ///< Maximum Shared Memory Per Multiprocessor. - hipDeviceAttributeIsMultiGpuBoard, ///< Multiple GPU devices. + hipDeviceAttributeMaxThreadsPerBlock, ///< Maximum number of threads per block. + hipDeviceAttributeMaxBlockDimX, ///< Maximum x-dimension of a block. + hipDeviceAttributeMaxBlockDimY, ///< Maximum y-dimension of a block. + hipDeviceAttributeMaxBlockDimZ, ///< Maximum z-dimension of a block. + hipDeviceAttributeMaxGridDimX, ///< Maximum x-dimension of a grid. + hipDeviceAttributeMaxGridDimY, ///< Maximum y-dimension of a grid. + hipDeviceAttributeMaxGridDimZ, ///< Maximum z-dimension of a grid. + hipDeviceAttributeMaxSharedMemoryPerBlock, ///< Maximum shared memory available per block in + ///< bytes. + hipDeviceAttributeTotalConstantMemory, ///< Constant memory size in bytes. + hipDeviceAttributeWarpSize, ///< Warp size in threads. + hipDeviceAttributeMaxRegistersPerBlock, ///< Maximum number of 32-bit registers available to a + ///< thread block. This number is shared by all thread + ///< blocks simultaneously resident on a + ///< multiprocessor. + hipDeviceAttributeClockRate, ///< Peak clock frequency in kilohertz. + hipDeviceAttributeMemoryClockRate, ///< Peak memory clock frequency in kilohertz. + hipDeviceAttributeMemoryBusWidth, ///< Global memory bus width in bits. + hipDeviceAttributeMultiprocessorCount, ///< Number of multiprocessors on the device. + hipDeviceAttributeComputeMode, ///< Compute mode that device is currently in. + hipDeviceAttributeL2CacheSize, ///< Size of L2 cache in bytes. 0 if the device doesn't have L2 + ///< cache. + hipDeviceAttributeMaxThreadsPerMultiProcessor, ///< Maximum resident threads per + ///< multiprocessor. + hipDeviceAttributeComputeCapabilityMajor, ///< Major compute capability version number. + hipDeviceAttributeComputeCapabilityMinor, ///< Minor compute capability version number. + hipDeviceAttributeConcurrentKernels, ///< Device can possibly execute multiple kernels + ///< concurrently. + hipDeviceAttributePciBusId, ///< PCI Bus ID. + hipDeviceAttributePciDeviceId, ///< PCI Device ID. + hipDeviceAttributeMaxSharedMemoryPerMultiprocessor, ///< Maximum Shared Memory Per + ///< Multiprocessor. + hipDeviceAttributeIsMultiGpuBoard, ///< Multiple GPU devices. } hipDeviceAttribute_t; @@ -268,9 +294,9 @@ typedef enum hipDeviceAttribute_t { * @} */ -#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__) +#if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_PLATFORM_NVCC__) #include "hip/hcc_detail/hip_runtime_api.h" -#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__) +#elif defined(__HIP_PLATFORM_NVCC__) && !defined(__HIP_PLATFORM_HCC__) #include "hip/nvcc_detail/hip_runtime_api.h" #else #error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); @@ -285,16 +311,16 @@ typedef enum hipDeviceAttribute_t { * @see hipMalloc */ #ifdef __cplusplus -template -static inline hipError_t hipMalloc ( T** devPtr, size_t size) -{ +template +static inline hipError_t hipMalloc(T** devPtr, size_t size) { return hipMalloc((void**)devPtr, size); } -// Provide an override to automatically typecast the pointer type from void**, and also provide a default for the flags. -template -static inline hipError_t hipHostMalloc( T** ptr, size_t size, unsigned int flags = hipHostMallocDefault) -{ +// Provide an override to automatically typecast the pointer type from void**, and also provide a +// default for the flags. +template +static inline hipError_t hipHostMalloc(T** ptr, size_t size, + unsigned int flags = hipHostMallocDefault) { return hipHostMalloc((void**)ptr, size, flags); } #endif diff --git a/hipamd/include/hip/hip_texture_types.h b/hipamd/include/hip/hip_texture_types.h index 44dc7a9e0f..a7feab011b 100644 --- a/hipamd/include/hip/hip_texture_types.h +++ b/hipamd/include/hip/hip_texture_types.h @@ -21,13 +21,12 @@ THE SOFTWARE. */ - #ifndef HIP_INCLUDE_HIP_HIP_TEXTURE_TYPES_H #define HIP_INCLUDE_HIP_HIP_TEXTURE_TYPES_H -#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__) +#if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_PLATFORM_NVCC__) #include -#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__) +#elif defined(__HIP_PLATFORM_NVCC__) && !defined(__HIP_PLATFORM_HCC__) #include #else #error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); diff --git a/hipamd/include/hip/hip_vector_types.h b/hipamd/include/hip/hip_vector_types.h index 1d3d6b92f6..c1a0373c06 100644 --- a/hipamd/include/hip/hip_vector_types.h +++ b/hipamd/include/hip/hip_vector_types.h @@ -28,11 +28,11 @@ THE SOFTWARE. #include -#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__) +#if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_PLATFORM_NVCC__) #if __cplusplus #include #endif -#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__) +#elif defined(__HIP_PLATFORM_NVCC__) && !defined(__HIP_PLATFORM_HCC__) #include #else #error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); diff --git a/hipamd/include/hip/math_functions.h b/hipamd/include/hip/math_functions.h index 6f47b5e0e2..23dddf9f9d 100644 --- a/hipamd/include/hip/math_functions.h +++ b/hipamd/include/hip/math_functions.h @@ -28,9 +28,9 @@ THE SOFTWARE. // on NVCC path: -#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__) +#if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_PLATFORM_NVCC__) #include -#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__) +#elif defined(__HIP_PLATFORM_NVCC__) && !defined(__HIP_PLATFORM_HCC__) //#include #else #error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); diff --git a/hipamd/include/hip/nvcc_detail/channel_descriptor.h b/hipamd/include/hip/nvcc_detail/channel_descriptor.h index 2e88c56268..c3e9dc1ff6 100644 --- a/hipamd/include/hip/nvcc_detail/channel_descriptor.h +++ b/hipamd/include/hip/nvcc_detail/channel_descriptor.h @@ -23,6 +23,6 @@ THE SOFTWARE. #ifndef HIP_INCLUDE_HIP_NVCC_DETAIL_CHANNEL_DESCRIPTOR_H #define HIP_INCLUDE_HIP_NVCC_DETAIL_CHANNEL_DESCRIPTOR_H -#include"channel_descriptor.h" +#include "channel_descriptor.h" #endif diff --git a/hipamd/include/hip/nvcc_detail/hip_complex.h b/hipamd/include/hip/nvcc_detail/hip_complex.h index 20cb24460c..ea2ddfdf4e 100644 --- a/hipamd/include/hip/nvcc_detail/hip_complex.h +++ b/hipamd/include/hip/nvcc_detail/hip_complex.h @@ -23,107 +23,92 @@ THE SOFTWARE. #ifndef HIP_INCLUDE_HIP_NVCC_DETAIL_HIP_COMPLEX_H #define HIP_INCLUDE_HIP_NVCC_DETAIL_HIP_COMPLEX_H -#include"cuComplex.h" +#include "cuComplex.h" typedef cuFloatComplex hipFloatComplex; -__device__ __host__ static inline float hipCrealf(hipFloatComplex z){ - return cuCrealf(z); -} +__device__ __host__ static inline float hipCrealf(hipFloatComplex z) { return cuCrealf(z); } -__device__ __host__ static inline float hipCimagf(hipFloatComplex z){ - return cuCimagf(z); -} +__device__ __host__ static inline float hipCimagf(hipFloatComplex z) { return cuCimagf(z); } -__device__ __host__ static inline hipFloatComplex make_hipFloatComplex(float a, float b){ +__device__ __host__ static inline hipFloatComplex make_hipFloatComplex(float a, float b) { return make_cuFloatComplex(a, b); } -__device__ __host__ static inline hipFloatComplex hipConjf(hipFloatComplex z){ - return cuConjf(z); -} +__device__ __host__ static inline hipFloatComplex hipConjf(hipFloatComplex z) { return cuConjf(z); } -__device__ __host__ static inline float hipCsqabsf(hipFloatComplex z){ +__device__ __host__ static inline float hipCsqabsf(hipFloatComplex z) { return cuCabsf(z) * cuCabsf(z); } -__device__ __host__ static inline hipFloatComplex hipCaddf(hipFloatComplex p, hipFloatComplex q){ +__device__ __host__ static inline hipFloatComplex hipCaddf(hipFloatComplex p, hipFloatComplex q) { return cuCaddf(p, q); } -__device__ __host__ static inline hipFloatComplex hipCsubf(hipFloatComplex p, hipFloatComplex q){ +__device__ __host__ static inline hipFloatComplex hipCsubf(hipFloatComplex p, hipFloatComplex q) { return cuCsubf(p, q); } -__device__ __host__ static inline hipFloatComplex hipCmulf(hipFloatComplex p, hipFloatComplex q){ +__device__ __host__ static inline hipFloatComplex hipCmulf(hipFloatComplex p, hipFloatComplex q) { return cuCmulf(p, q); } -__device__ __host__ static inline hipFloatComplex hipCdivf(hipFloatComplex p, hipFloatComplex q){ +__device__ __host__ static inline hipFloatComplex hipCdivf(hipFloatComplex p, hipFloatComplex q) { return cuCdivf(p, q); } -__device__ __host__ static inline float hipCabsf(hipFloatComplex z){ - return cuCabsf(z); -} +__device__ __host__ static inline float hipCabsf(hipFloatComplex z) { return cuCabsf(z); } typedef cuDoubleComplex hipDoubleComplex; -__device__ __host__ static inline double hipCreal(hipDoubleComplex z){ - return cuCreal(z); -} +__device__ __host__ static inline double hipCreal(hipDoubleComplex z) { return cuCreal(z); } -__device__ __host__ static inline double hipCimag(hipDoubleComplex z){ - return cuCimag(z); -} +__device__ __host__ static inline double hipCimag(hipDoubleComplex z) { return cuCimag(z); } -__device__ __host__ static inline hipDoubleComplex make_hipDoubleComplex(double a, double b){ +__device__ __host__ static inline hipDoubleComplex make_hipDoubleComplex(double a, double b) { return make_cuDoubleComplex(a, b); } -__device__ __host__ static inline hipDoubleComplex hipConj(hipDoubleComplex z){ - return cuConj(z); -} +__device__ __host__ static inline hipDoubleComplex hipConj(hipDoubleComplex z) { return cuConj(z); } -__device__ __host__ static inline double hipCsqabs(hipDoubleComplex z){ +__device__ __host__ static inline double hipCsqabs(hipDoubleComplex z) { return cuCabs(z) * cuCabs(z); } -__device__ __host__ static inline hipDoubleComplex hipCadd(hipDoubleComplex p, hipDoubleComplex q){ +__device__ __host__ static inline hipDoubleComplex hipCadd(hipDoubleComplex p, hipDoubleComplex q) { return cuCadd(p, q); } -__device__ __host__ static inline hipDoubleComplex hipCsub(hipDoubleComplex p, hipDoubleComplex q){ +__device__ __host__ static inline hipDoubleComplex hipCsub(hipDoubleComplex p, hipDoubleComplex q) { return cuCsub(p, q); } -__device__ __host__ static inline hipDoubleComplex hipCdiv(hipDoubleComplex p, hipDoubleComplex q){ +__device__ __host__ static inline hipDoubleComplex hipCdiv(hipDoubleComplex p, hipDoubleComplex q) { return cuCdiv(p, q); } -__device__ __host__ static inline double hipCabs(hipDoubleComplex z){ - return cuCabs(z); -} +__device__ __host__ static inline double hipCabs(hipDoubleComplex z) { return cuCabs(z); } typedef cuFloatComplex hipComplex; -__device__ __host__ static inline hipComplex make_Complex(float x, float y){ +__device__ __host__ static inline hipComplex make_Complex(float x, float y) { return make_cuComplex(x, y); } -__device__ __host__ static inline hipFloatComplex hipComplexDoubleToFloat(hipDoubleComplex z){ +__device__ __host__ static inline hipFloatComplex hipComplexDoubleToFloat(hipDoubleComplex z) { return cuComplexDoubleToFloat(z); } -__device__ __host__ static inline hipDoubleComplex hipComplexFloatToDouble(hipFloatComplex z){ +__device__ __host__ static inline hipDoubleComplex hipComplexFloatToDouble(hipFloatComplex z) { return cuComplexFloatToDouble(z); } -__device__ __host__ static inline hipComplex hipCfmaf(hipComplex p, hipComplex q, hipComplex r){ +__device__ __host__ static inline hipComplex hipCfmaf(hipComplex p, hipComplex q, hipComplex r) { return cuCfmaf(p, q, r); } -__device__ __host__ static inline hipDoubleComplex hipCfma(hipDoubleComplex p, hipDoubleComplex q, hipDoubleComplex r){ +__device__ __host__ static inline hipDoubleComplex hipCfma(hipDoubleComplex p, hipDoubleComplex q, + hipDoubleComplex r) { return cuCfma(p, q, r); } diff --git a/hipamd/include/hip/nvcc_detail/hip_runtime.h b/hipamd/include/hip/nvcc_detail/hip_runtime.h index fca9ab6e39..fe0b19bf8c 100644 --- a/hipamd/include/hip/nvcc_detail/hip_runtime.h +++ b/hipamd/include/hip/nvcc_detail/hip_runtime.h @@ -29,74 +29,72 @@ THE SOFTWARE. #define HIP_KERNEL_NAME(...) __VA_ARGS__ -typedef int hipLaunchParm ; +typedef int hipLaunchParm; -#define hipLaunchKernel(kernelName, numblocks, numthreads, memperblock, streamId, ...) \ -do {\ -kernelName<<>>(0, ##__VA_ARGS__);\ -} while(0) +#define hipLaunchKernel(kernelName, numblocks, numthreads, memperblock, streamId, ...) \ + do { \ + kernelName<<>>(0, ##__VA_ARGS__); \ + } while (0) -#define hipLaunchKernelGGL(kernelName, numblocks, numthreads, memperblock, streamId, ...) \ -do {\ -kernelName<<>>(__VA_ARGS__);\ -} while(0) +#define hipLaunchKernelGGL(kernelName, numblocks, numthreads, memperblock, streamId, ...) \ + do { \ + kernelName<<>>(__VA_ARGS__); \ + } while (0) #define hipReadModeElementType cudaReadModeElementType #ifdef __CUDA_ARCH__ - // 32-bit Atomics: -#define __HIP_ARCH_HAS_GLOBAL_INT32_ATOMICS__ (__CUDA_ARCH__ >= 110) -#define __HIP_ARCH_HAS_GLOBAL_FLOAT_ATOMIC_EXCH__ (__CUDA_ARCH__ >= 110) -#define __HIP_ARCH_HAS_SHARED_INT32_ATOMICS__ (__CUDA_ARCH__ >= 120) -#define __HIP_ARCH_HAS_SHARED_FLOAT_ATOMIC_EXCH__ (__CUDA_ARCH__ >= 120) -#define __HIP_ARCH_HAS_FLOAT_ATOMIC_ADD__ (__CUDA_ARCH__ >= 200) +// 32-bit Atomics: +#define __HIP_ARCH_HAS_GLOBAL_INT32_ATOMICS__ (__CUDA_ARCH__ >= 110) +#define __HIP_ARCH_HAS_GLOBAL_FLOAT_ATOMIC_EXCH__ (__CUDA_ARCH__ >= 110) +#define __HIP_ARCH_HAS_SHARED_INT32_ATOMICS__ (__CUDA_ARCH__ >= 120) +#define __HIP_ARCH_HAS_SHARED_FLOAT_ATOMIC_EXCH__ (__CUDA_ARCH__ >= 120) +#define __HIP_ARCH_HAS_FLOAT_ATOMIC_ADD__ (__CUDA_ARCH__ >= 200) // 64-bit Atomics: -#define __HIP_ARCH_HAS_GLOBAL_INT64_ATOMICS__ (__CUDA_ARCH__ >= 200) -#define __HIP_ARCH_HAS_SHARED_INT64_ATOMICS__ (__CUDA_ARCH__ >= 120) +#define __HIP_ARCH_HAS_GLOBAL_INT64_ATOMICS__ (__CUDA_ARCH__ >= 200) +#define __HIP_ARCH_HAS_SHARED_INT64_ATOMICS__ (__CUDA_ARCH__ >= 120) // Doubles -#define __HIP_ARCH_HAS_DOUBLES__ (__CUDA_ARCH__ >= 120) +#define __HIP_ARCH_HAS_DOUBLES__ (__CUDA_ARCH__ >= 120) -//warp cross-lane operations: -#define __HIP_ARCH_HAS_WARP_VOTE__ (__CUDA_ARCH__ >= 120) -#define __HIP_ARCH_HAS_WARP_BALLOT__ (__CUDA_ARCH__ >= 200) -#define __HIP_ARCH_HAS_WARP_SHUFFLE__ (__CUDA_ARCH__ >= 300) -#define __HIP_ARCH_HAS_WARP_FUNNEL_SHIFT__ (__CUDA_ARCH__ >= 350) +// warp cross-lane operations: +#define __HIP_ARCH_HAS_WARP_VOTE__ (__CUDA_ARCH__ >= 120) +#define __HIP_ARCH_HAS_WARP_BALLOT__ (__CUDA_ARCH__ >= 200) +#define __HIP_ARCH_HAS_WARP_SHUFFLE__ (__CUDA_ARCH__ >= 300) +#define __HIP_ARCH_HAS_WARP_FUNNEL_SHIFT__ (__CUDA_ARCH__ >= 350) -//sync -#define __HIP_ARCH_HAS_THREAD_FENCE_SYSTEM__ (__CUDA_ARCH__ >= 200) -#define __HIP_ARCH_HAS_SYNC_THREAD_EXT__ (__CUDA_ARCH__ >= 200) +// sync +#define __HIP_ARCH_HAS_THREAD_FENCE_SYSTEM__ (__CUDA_ARCH__ >= 200) +#define __HIP_ARCH_HAS_SYNC_THREAD_EXT__ (__CUDA_ARCH__ >= 200) // misc -#define __HIP_ARCH_HAS_SURFACE_FUNCS__ (__CUDA_ARCH__ >= 200) -#define __HIP_ARCH_HAS_3DGRID__ (__CUDA_ARCH__ >= 200) -#define __HIP_ARCH_HAS_DYNAMIC_PARALLEL__ (__CUDA_ARCH__ >= 350) +#define __HIP_ARCH_HAS_SURFACE_FUNCS__ (__CUDA_ARCH__ >= 200) +#define __HIP_ARCH_HAS_3DGRID__ (__CUDA_ARCH__ >= 200) +#define __HIP_ARCH_HAS_DYNAMIC_PARALLEL__ (__CUDA_ARCH__ >= 350) #endif #ifdef __CUDACC__ - - #define hipThreadIdx_x threadIdx.x #define hipThreadIdx_y threadIdx.y #define hipThreadIdx_z threadIdx.z -#define hipBlockIdx_x blockIdx.x -#define hipBlockIdx_y blockIdx.y -#define hipBlockIdx_z blockIdx.z +#define hipBlockIdx_x blockIdx.x +#define hipBlockIdx_y blockIdx.y +#define hipBlockIdx_z blockIdx.z -#define hipBlockDim_x blockDim.x -#define hipBlockDim_y blockDim.y -#define hipBlockDim_z blockDim.z +#define hipBlockDim_x blockDim.x +#define hipBlockDim_y blockDim.y +#define hipBlockDim_z blockDim.z -#define hipGridDim_x gridDim.x -#define hipGridDim_y gridDim.y -#define hipGridDim_z gridDim.z +#define hipGridDim_x gridDim.x +#define hipGridDim_y gridDim.y +#define hipGridDim_z gridDim.z #define HIP_SYMBOL(X) X @@ -104,15 +102,20 @@ kernelName<<>>(__VA_ARGS__);\ * extern __shared__ */ -#define HIP_DYNAMIC_SHARED(type, var) \ - extern __shared__ type var[]; \ +#define HIP_DYNAMIC_SHARED(type, var) extern __shared__ type var[]; #define HIP_DYNAMIC_SHARED_ATTRIBUTE #ifdef __HIP_DEVICE_COMPILE__ -#define abort() {asm("trap;");} +#define abort() \ + { asm("trap;"); } #undef assert -#define assert(COND) { if (!COND) {abort();} } +#define assert(COND) \ + { \ + if (!COND) { \ + abort(); \ + } \ + } #endif #endif diff --git a/hipamd/include/hip/nvcc_detail/hip_runtime_api.h b/hipamd/include/hip/nvcc_detail/hip_runtime_api.h index e1050e21e8..1ab3b258db 100644 --- a/hipamd/include/hip/nvcc_detail/hip_runtime_api.h +++ b/hipamd/include/hip/nvcc_detail/hip_runtime_api.h @@ -32,55 +32,54 @@ extern "C" { #endif #ifdef __cplusplus - #define __dparm(x) \ - = x +#define __dparm(x) = x #else - #define __dparm(x) +#define __dparm(x) #endif - - //TODO -move to include/hip_runtime_api.h as a common implementation. -/** -* Memory copy types -* -*/ -typedef enum hipMemcpyKind { -hipMemcpyHostToHost -,hipMemcpyHostToDevice -,hipMemcpyDeviceToHost -,hipMemcpyDeviceToDevice -,hipMemcpyDefault -} hipMemcpyKind ; -//hipTextureAddressMode +// TODO -move to include/hip_runtime_api.h as a common implementation. +/** + * Memory copy types + * + */ +typedef enum hipMemcpyKind { + hipMemcpyHostToHost, + hipMemcpyHostToDevice, + hipMemcpyDeviceToHost, + hipMemcpyDeviceToDevice, + hipMemcpyDefault +} hipMemcpyKind; + +// hipTextureAddressMode #define hipTextureAddressMode cudaTextureAddressMode #define hipAddressModeWrap cudaAddressModeWrap #define hipAddressModeClamp cudaAddressModeClamp #define hipAddressModeMirror cudaAddressModeMirror #define hipAddressModeBorder cudaAddressModeBorder -//hipTextureFilterMode +// hipTextureFilterMode #define hipTextureFilterMode cudaTextureFilterMode #define hipFilterModePoint cudaFilterModePoint #define hipFilterModeLinear cudaFilterModeLinear -//hipTextureReadMode +// hipTextureReadMode #define hipTextureReadMode cudaTextureReadMode #define hipReadModeElementType cudaReadModeElementType #define hipReadModeNormalizedFloat cudaReadModeNormalizedFloat typedef enum hipChannelFormatKind { hipChannelFormatKindSigned = 0, - hipChannelFormatKindUnsigned = 1, + hipChannelFormatKindUnsigned = 1, hipChannelFormatKindFloat = 2, hipChannelFormatKindNone = 3 -}hipChannelFormatKind; +} hipChannelFormatKind; #define hipSurfaceBoundaryMode cudaSurfaceBoundaryMode #define hipBoundaryModeZero cudaBoundaryModeZero #define hipBoundaryModeTrap cudaBoundaryModeTrap #define hipBoundaryModeClamp cudaBoundaryModeClamp -//hipResourceType +// hipResourceType #define hipResourceType cudaResourceType #define hipResourceTypeArray cudaResourceTypeArray #define hipResourceTypeMipmappedArray cudaResourceTypeMipmappedArray @@ -91,49 +90,49 @@ typedef enum hipChannelFormatKind { //! Flags that can be used with hipEventCreateWithFlags: -#define hipEventDefault cudaEventDefault -#define hipEventBlockingSync cudaEventBlockingSync -#define hipEventDisableTiming cudaEventDisableTiming -#define hipEventInterprocess cudaEventInterprocess -#define hipEventReleaseToDevice 0 /* no-op on CUDA platform */ -#define hipEventReleaseToSystem 0 /* no-op on CUDA platform */ +#define hipEventDefault cudaEventDefault +#define hipEventBlockingSync cudaEventBlockingSync +#define hipEventDisableTiming cudaEventDisableTiming +#define hipEventInterprocess cudaEventInterprocess +#define hipEventReleaseToDevice 0 /* no-op on CUDA platform */ +#define hipEventReleaseToSystem 0 /* no-op on CUDA platform */ -#define hipHostMallocDefault cudaHostAllocDefault -#define hipHostMallocPortable cudaHostAllocPortable -#define hipHostMallocMapped cudaHostAllocMapped +#define hipHostMallocDefault cudaHostAllocDefault +#define hipHostMallocPortable cudaHostAllocPortable +#define hipHostMallocMapped cudaHostAllocMapped #define hipHostMallocWriteCombined cudaHostAllocWriteCombined -#define hipHostMallocCoherent 0x0 -#define hipHostMallocNonCoherent 0x0 +#define hipHostMallocCoherent 0x0 +#define hipHostMallocNonCoherent 0x0 #define hipHostRegisterPortable cudaHostRegisterPortable -#define hipHostRegisterMapped cudaHostRegisterMapped +#define hipHostRegisterMapped cudaHostRegisterMapped #define HIP_LAUNCH_PARAM_BUFFER_POINTER CU_LAUNCH_PARAM_BUFFER_POINTER -#define HIP_LAUNCH_PARAM_BUFFER_SIZE CU_LAUNCH_PARAM_BUFFER_SIZE -#define HIP_LAUNCH_PARAM_END CU_LAUNCH_PARAM_END -#define hipLimitMallocHeapSize cudaLimitMallocHeapSize -#define hipIpcMemLazyEnablePeerAccess cudaIpcMemLazyEnablePeerAccess +#define HIP_LAUNCH_PARAM_BUFFER_SIZE CU_LAUNCH_PARAM_BUFFER_SIZE +#define HIP_LAUNCH_PARAM_END CU_LAUNCH_PARAM_END +#define hipLimitMallocHeapSize cudaLimitMallocHeapSize +#define hipIpcMemLazyEnablePeerAccess cudaIpcMemLazyEnablePeerAccess // enum CUjit_option redefines -#define hipJitOptionMaxRegisters CU_JIT_MAX_REGISTERS -#define hipJitOptionThreadsPerBlock CU_JIT_THREADS_PER_BLOCK -#define hipJitOptionWallTime CU_JIT_WALL_TIME -#define hipJitOptionInfoLogBuffer CU_JIT_INFO_LOG_BUFFER -#define hipJitOptionInfoLogBufferSizeBytes CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES -#define hipJitOptionErrorLogBuffer CU_JIT_ERROR_LOG_BUFFER +#define hipJitOptionMaxRegisters CU_JIT_MAX_REGISTERS +#define hipJitOptionThreadsPerBlock CU_JIT_THREADS_PER_BLOCK +#define hipJitOptionWallTime CU_JIT_WALL_TIME +#define hipJitOptionInfoLogBuffer CU_JIT_INFO_LOG_BUFFER +#define hipJitOptionInfoLogBufferSizeBytes CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES +#define hipJitOptionErrorLogBuffer CU_JIT_ERROR_LOG_BUFFER #define hipJitOptionErrorLogBufferSizeBytes CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES -#define hipJitOptionOptimizationLevel CU_JIT_OPTIMIZATION_LEVEL -#define hipJitOptionTargetFromContext CU_JIT_TARGET_FROM_CUCONTEXT -#define hipJitOptionTarget CU_JIT_TARGET -#define hipJitOptionFallbackStrategy CU_JIT_FALLBACK_STRATEGY -#define hipJitOptionGenerateDebugInfo CU_JIT_GENERATE_DEBUG_INFO -#define hipJitOptionLogVerbose CU_JIT_LOG_VERBOSE -#define hipJitOptionGenerateLineInfo CU_JIT_GENERATE_LINE_INFO -#define hipJitOptionCacheMode CU_JIT_CACHE_MODE -#define hipJitOptionSm3xOpt CU_JIT_NEW_SM3X_OPT -#define hipJitOptionFastCompile CU_JIT_FAST_COMPILE -#define hipJitOptionNumOptions CU_JIT_NUM_OPTIONS +#define hipJitOptionOptimizationLevel CU_JIT_OPTIMIZATION_LEVEL +#define hipJitOptionTargetFromContext CU_JIT_TARGET_FROM_CUCONTEXT +#define hipJitOptionTarget CU_JIT_TARGET +#define hipJitOptionFallbackStrategy CU_JIT_FALLBACK_STRATEGY +#define hipJitOptionGenerateDebugInfo CU_JIT_GENERATE_DEBUG_INFO +#define hipJitOptionLogVerbose CU_JIT_LOG_VERBOSE +#define hipJitOptionGenerateLineInfo CU_JIT_GENERATE_LINE_INFO +#define hipJitOptionCacheMode CU_JIT_CACHE_MODE +#define hipJitOptionSm3xOpt CU_JIT_NEW_SM3X_OPT +#define hipJitOptionFastCompile CU_JIT_FAST_COMPILE +#define hipJitOptionNumOptions CU_JIT_NUM_OPTIONS typedef cudaEvent_t hipEvent_t; typedef cudaStream_t hipStream_t; @@ -159,165 +158,210 @@ typedef cudaSurfaceObject_t hipSurfaceObject_t; #define hipDeviceMapHost cudaDeviceMapHost // Flags that can be used with hipStreamCreateWithFlags -#define hipStreamDefault cudaStreamDefault -#define hipStreamNonBlocking cudaStreamNonBlocking +#define hipStreamDefault cudaStreamDefault +#define hipStreamNonBlocking cudaStreamNonBlocking #define hipChannelFormatDesc cudaChannelFormatDesc #define hipResourceDesc cudaResourceDesc #define hipTextureDesc cudaTextureDesc #define hipResourceViewDesc cudaResourceViewDesc -//adding code for hipmemSharedConfig +// adding code for hipmemSharedConfig #define hipSharedMemBankSizeDefault cudaSharedMemBankSizeDefault #define hipSharedMemBankSizeFourByte cudaSharedMemBankSizeFourByte #define hipSharedMemBankSizeEightByte cudaSharedMemBankSizeEightByte inline static hipError_t hipCUDAErrorTohipError(cudaError_t cuError) { -switch(cuError) { - case cudaSuccess : return hipSuccess; - case cudaErrorMemoryAllocation : return hipErrorMemoryAllocation ; - case cudaErrorLaunchOutOfResources : return hipErrorLaunchOutOfResources ; - case cudaErrorInvalidValue : return hipErrorInvalidValue ; - case cudaErrorInvalidResourceHandle : return hipErrorInvalidResourceHandle ; - case cudaErrorInvalidDevice : return hipErrorInvalidDevice ; - case cudaErrorInvalidMemcpyDirection : return hipErrorInvalidMemcpyDirection ; - case cudaErrorInvalidDevicePointer : return hipErrorInvalidDevicePointer ; - case cudaErrorInitializationError : return hipErrorInitializationError ; - case cudaErrorNoDevice : return hipErrorNoDevice ; - case cudaErrorNotReady : return hipErrorNotReady ; - case cudaErrorUnknown : return hipErrorUnknown ; - case cudaErrorPeerAccessNotEnabled : return hipErrorPeerAccessNotEnabled ; - case cudaErrorPeerAccessAlreadyEnabled : return hipErrorPeerAccessAlreadyEnabled ; - case cudaErrorHostMemoryAlreadyRegistered : return hipErrorHostMemoryAlreadyRegistered ; - case cudaErrorHostMemoryNotRegistered : return hipErrorHostMemoryNotRegistered ; - case cudaErrorUnsupportedLimit : return hipErrorUnsupportedLimit ; - default : return hipErrorUnknown; // Note - translated error. -} + switch (cuError) { + case cudaSuccess: + return hipSuccess; + case cudaErrorMemoryAllocation: + return hipErrorMemoryAllocation; + case cudaErrorLaunchOutOfResources: + return hipErrorLaunchOutOfResources; + case cudaErrorInvalidValue: + return hipErrorInvalidValue; + case cudaErrorInvalidResourceHandle: + return hipErrorInvalidResourceHandle; + case cudaErrorInvalidDevice: + return hipErrorInvalidDevice; + case cudaErrorInvalidMemcpyDirection: + return hipErrorInvalidMemcpyDirection; + case cudaErrorInvalidDevicePointer: + return hipErrorInvalidDevicePointer; + case cudaErrorInitializationError: + return hipErrorInitializationError; + case cudaErrorNoDevice: + return hipErrorNoDevice; + case cudaErrorNotReady: + return hipErrorNotReady; + case cudaErrorUnknown: + return hipErrorUnknown; + case cudaErrorPeerAccessNotEnabled: + return hipErrorPeerAccessNotEnabled; + case cudaErrorPeerAccessAlreadyEnabled: + return hipErrorPeerAccessAlreadyEnabled; + case cudaErrorHostMemoryAlreadyRegistered: + return hipErrorHostMemoryAlreadyRegistered; + case cudaErrorHostMemoryNotRegistered: + return hipErrorHostMemoryNotRegistered; + case cudaErrorUnsupportedLimit: + return hipErrorUnsupportedLimit; + default: + return hipErrorUnknown; // Note - translated error. + } } -inline static hipError_t hipCUResultTohipError(CUresult cuError) { //TODO Populate further -switch(cuError) { - case CUDA_SUCCESS : return hipSuccess; - case CUDA_ERROR_OUT_OF_MEMORY : return hipErrorMemoryAllocation ; - case CUDA_ERROR_INVALID_VALUE : return hipErrorInvalidValue ; - case CUDA_ERROR_INVALID_DEVICE : return hipErrorInvalidDevice ; - case CUDA_ERROR_DEINITIALIZED : return hipErrorDeinitialized ; - case CUDA_ERROR_NO_DEVICE : return hipErrorNoDevice ; - case CUDA_ERROR_INVALID_CONTEXT : return hipErrorInvalidContext ; - case CUDA_ERROR_NOT_INITIALIZED : return hipErrorNotInitialized ; - default : return hipErrorUnknown; // Note - translated error. -} +inline static hipError_t hipCUResultTohipError(CUresult cuError) { // TODO Populate further + switch (cuError) { + case CUDA_SUCCESS: + return hipSuccess; + case CUDA_ERROR_OUT_OF_MEMORY: + return hipErrorMemoryAllocation; + case CUDA_ERROR_INVALID_VALUE: + return hipErrorInvalidValue; + case CUDA_ERROR_INVALID_DEVICE: + return hipErrorInvalidDevice; + case CUDA_ERROR_DEINITIALIZED: + return hipErrorDeinitialized; + case CUDA_ERROR_NO_DEVICE: + return hipErrorNoDevice; + case CUDA_ERROR_INVALID_CONTEXT: + return hipErrorInvalidContext; + case CUDA_ERROR_NOT_INITIALIZED: + return hipErrorNotInitialized; + default: + return hipErrorUnknown; // Note - translated error. + } } // TODO match the error enum names of hip and cuda inline static cudaError_t hipErrorToCudaError(hipError_t hError) { -switch(hError) { - case hipSuccess : return cudaSuccess; - case hipErrorMemoryAllocation : return cudaErrorMemoryAllocation ; - case hipErrorLaunchOutOfResources : return cudaErrorLaunchOutOfResources ; - case hipErrorInvalidValue : return cudaErrorInvalidValue ; - case hipErrorInvalidResourceHandle : return cudaErrorInvalidResourceHandle ; - case hipErrorInvalidDevice : return cudaErrorInvalidDevice ; - case hipErrorInvalidMemcpyDirection : return cudaErrorInvalidMemcpyDirection ; - case hipErrorInvalidDevicePointer : return cudaErrorInvalidDevicePointer ; - case hipErrorInitializationError : return cudaErrorInitializationError ; - case hipErrorNoDevice : return cudaErrorNoDevice ; - case hipErrorNotReady : return cudaErrorNotReady ; - case hipErrorUnknown : return cudaErrorUnknown ; - case hipErrorPeerAccessNotEnabled : return cudaErrorPeerAccessNotEnabled ; - case hipErrorPeerAccessAlreadyEnabled : return cudaErrorPeerAccessAlreadyEnabled ; - case hipErrorRuntimeMemory : return cudaErrorUnknown ; // Does not exist in CUDA - case hipErrorRuntimeOther : return cudaErrorUnknown ; // Does not exist in CUDA - case hipErrorHostMemoryAlreadyRegistered : return cudaErrorHostMemoryAlreadyRegistered ; - case hipErrorHostMemoryNotRegistered : return cudaErrorHostMemoryNotRegistered ; - case hipErrorTbd : return cudaErrorUnknown; // Note - translated error. - default : return cudaErrorUnknown; // Note - translated error. -} + switch (hError) { + case hipSuccess: + return cudaSuccess; + case hipErrorMemoryAllocation: + return cudaErrorMemoryAllocation; + case hipErrorLaunchOutOfResources: + return cudaErrorLaunchOutOfResources; + case hipErrorInvalidValue: + return cudaErrorInvalidValue; + case hipErrorInvalidResourceHandle: + return cudaErrorInvalidResourceHandle; + case hipErrorInvalidDevice: + return cudaErrorInvalidDevice; + case hipErrorInvalidMemcpyDirection: + return cudaErrorInvalidMemcpyDirection; + case hipErrorInvalidDevicePointer: + return cudaErrorInvalidDevicePointer; + case hipErrorInitializationError: + return cudaErrorInitializationError; + case hipErrorNoDevice: + return cudaErrorNoDevice; + case hipErrorNotReady: + return cudaErrorNotReady; + case hipErrorUnknown: + return cudaErrorUnknown; + case hipErrorPeerAccessNotEnabled: + return cudaErrorPeerAccessNotEnabled; + case hipErrorPeerAccessAlreadyEnabled: + return cudaErrorPeerAccessAlreadyEnabled; + case hipErrorRuntimeMemory: + return cudaErrorUnknown; // Does not exist in CUDA + case hipErrorRuntimeOther: + return cudaErrorUnknown; // Does not exist in CUDA + case hipErrorHostMemoryAlreadyRegistered: + return cudaErrorHostMemoryAlreadyRegistered; + case hipErrorHostMemoryNotRegistered: + return cudaErrorHostMemoryNotRegistered; + case hipErrorTbd: + return cudaErrorUnknown; // Note - translated error. + default: + return cudaErrorUnknown; // Note - translated error. + } } inline static enum cudaMemcpyKind hipMemcpyKindToCudaMemcpyKind(hipMemcpyKind kind) { - switch(kind) { - case hipMemcpyHostToHost: - return cudaMemcpyHostToHost; - case hipMemcpyHostToDevice: - return cudaMemcpyHostToDevice; - case hipMemcpyDeviceToHost: - return cudaMemcpyDeviceToHost; - case hipMemcpyDeviceToDevice: - return cudaMemcpyDeviceToDevice; - default: - return cudaMemcpyDefault; -} + switch (kind) { + case hipMemcpyHostToHost: + return cudaMemcpyHostToHost; + case hipMemcpyHostToDevice: + return cudaMemcpyHostToDevice; + case hipMemcpyDeviceToHost: + return cudaMemcpyDeviceToHost; + case hipMemcpyDeviceToDevice: + return cudaMemcpyDeviceToDevice; + default: + return cudaMemcpyDefault; + } } -inline static cudaTextureAddressMode hipTextureAddressModeToCudaTextureAddressMode(hipTextureAddressMode kind) { - switch(kind) { - case hipAddressModeWrap: - return cudaAddressModeWrap; - case hipAddressModeClamp: - return cudaAddressModeClamp; - case hipAddressModeMirror: - return cudaAddressModeMirror; - case hipAddressModeBorder: - return cudaAddressModeBorder; - default: - return cudaAddressModeWrap; -} +inline static cudaTextureAddressMode hipTextureAddressModeToCudaTextureAddressMode( + hipTextureAddressMode kind) { + switch (kind) { + case hipAddressModeWrap: + return cudaAddressModeWrap; + case hipAddressModeClamp: + return cudaAddressModeClamp; + case hipAddressModeMirror: + return cudaAddressModeMirror; + case hipAddressModeBorder: + return cudaAddressModeBorder; + default: + return cudaAddressModeWrap; + } } -inline static cudaTextureFilterMode hipTextureFilterModeToCudaTextureFilterMode(hipTextureFilterMode kind) { - switch(kind) { - case hipFilterModePoint: - return cudaFilterModePoint; - case hipFilterModeLinear: - return cudaFilterModeLinear; - default: - return cudaFilterModePoint; -} +inline static cudaTextureFilterMode hipTextureFilterModeToCudaTextureFilterMode( + hipTextureFilterMode kind) { + switch (kind) { + case hipFilterModePoint: + return cudaFilterModePoint; + case hipFilterModeLinear: + return cudaFilterModeLinear; + default: + return cudaFilterModePoint; + } } inline static cudaTextureReadMode hipTextureReadModeToCudaTextureReadMode(hipTextureReadMode kind) { - switch(kind) { - case hipReadModeElementType: - return cudaReadModeElementType; - case hipReadModeNormalizedFloat: - return cudaReadModeNormalizedFloat; - default: - return cudaReadModeElementType; -} + switch (kind) { + case hipReadModeElementType: + return cudaReadModeElementType; + case hipReadModeNormalizedFloat: + return cudaReadModeNormalizedFloat; + default: + return cudaReadModeElementType; + } } -inline static cudaChannelFormatKind hipChannelFormatKindToCudaChannelFormatKind(hipChannelFormatKind kind) { - switch(kind) { - case hipChannelFormatKindSigned : - return cudaChannelFormatKindSigned ; - case hipChannelFormatKindUnsigned : - return cudaChannelFormatKindUnsigned ; - case hipChannelFormatKindFloat : - return cudaChannelFormatKindFloat ; - case hipChannelFormatKindNone : - return cudaChannelFormatKindNone ; - default: - return cudaChannelFormatKindNone ; -} +inline static cudaChannelFormatKind hipChannelFormatKindToCudaChannelFormatKind( + hipChannelFormatKind kind) { + switch (kind) { + case hipChannelFormatKindSigned: + return cudaChannelFormatKindSigned; + case hipChannelFormatKindUnsigned: + return cudaChannelFormatKindUnsigned; + case hipChannelFormatKindFloat: + return cudaChannelFormatKindFloat; + case hipChannelFormatKindNone: + return cudaChannelFormatKindNone; + default: + return cudaChannelFormatKindNone; + } } /** * Stream CallBack struct */ #define HIPRT_CB CUDART_CB -typedef void(HIPRT_CB * hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData); -inline static hipError_t hipInit(unsigned int flags) -{ +typedef void(HIPRT_CB* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData); +inline static hipError_t hipInit(unsigned int flags) { return hipCUResultTohipError(cuInit(flags)); } -inline static hipError_t hipDeviceReset() { - return hipCUDAErrorTohipError(cudaDeviceReset()); -} +inline static hipError_t hipDeviceReset() { return hipCUDAErrorTohipError(cudaDeviceReset()); } -inline static hipError_t hipGetLastError() { - return hipCUDAErrorTohipError(cudaGetLastError()); -} +inline static hipError_t hipGetLastError() { return hipCUDAErrorTohipError(cudaGetLastError()); } inline static hipError_t hipPeekAtLastError() { return hipCUDAErrorTohipError(cudaPeekAtLastError()); @@ -331,55 +375,57 @@ inline static hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, return hipCUDAErrorTohipError(cudaMallocPitch(ptr, pitch, width, height)); } -inline static hipError_t hipFree(void* ptr) { - return hipCUDAErrorTohipError(cudaFree(ptr)); -} +inline static hipError_t hipFree(void* ptr) { return hipCUDAErrorTohipError(cudaFree(ptr)); } -inline static hipError_t hipMallocHost(void** ptr, size_t size) __attribute__((deprecated("use hipHostMalloc instead"))); +inline static hipError_t hipMallocHost(void** ptr, size_t size) + __attribute__((deprecated("use hipHostMalloc instead"))); inline static hipError_t hipMallocHost(void** ptr, size_t size) { return hipCUDAErrorTohipError(cudaMallocHost(ptr, size)); } -inline static hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags) __attribute__((deprecated("use hipHostMalloc instead"))); -inline static hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags){ - return hipCUDAErrorTohipError(cudaHostAlloc(ptr, size, flags)); +inline static hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags) + __attribute__((deprecated("use hipHostMalloc instead"))); +inline static hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags) { + return hipCUDAErrorTohipError(cudaHostAlloc(ptr, size, flags)); } -inline static hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags){ - return hipCUDAErrorTohipError(cudaHostAlloc(ptr, size, flags)); +inline static hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags) { + return hipCUDAErrorTohipError(cudaHostAlloc(ptr, size, flags)); } inline static hipError_t hipMallocArray(hipArray** array, const struct hipChannelFormatDesc* desc, - size_t width, size_t height, unsigned int flags __dparm(hipArrayDefault)) { + size_t width, size_t height, + unsigned int flags __dparm(hipArrayDefault)) { return hipCUDAErrorTohipError(cudaMallocArray(array, desc, width, height, flags)); } inline static hipError_t hipFreeArray(hipArray* array) { - return hipCUDAErrorTohipError(cudaFreeArray(array)); + return hipCUDAErrorTohipError(cudaFreeArray(array)); } -inline static hipError_t hipHostGetDevicePointer(void** devPtr, void* hostPtr, unsigned int flags){ - return hipCUDAErrorTohipError(cudaHostGetDevicePointer(devPtr, hostPtr, flags)); +inline static hipError_t hipHostGetDevicePointer(void** devPtr, void* hostPtr, unsigned int flags) { + return hipCUDAErrorTohipError(cudaHostGetDevicePointer(devPtr, hostPtr, flags)); } -inline static hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr){ - return hipCUDAErrorTohipError(cudaHostGetFlags(flagsPtr, hostPtr)); +inline static hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr) { + return hipCUDAErrorTohipError(cudaHostGetFlags(flagsPtr, hostPtr)); } -inline static hipError_t hipHostRegister(void* ptr, size_t size, unsigned int flags){ - return hipCUDAErrorTohipError(cudaHostRegister(ptr, size, flags)); +inline static hipError_t hipHostRegister(void* ptr, size_t size, unsigned int flags) { + return hipCUDAErrorTohipError(cudaHostRegister(ptr, size, flags)); } -inline static hipError_t hipHostUnregister(void* ptr){ - return hipCUDAErrorTohipError(cudaHostUnregister(ptr)); +inline static hipError_t hipHostUnregister(void* ptr) { + return hipCUDAErrorTohipError(cudaHostUnregister(ptr)); } -inline static hipError_t hipFreeHost(void* ptr) __attribute__((deprecated("use hipHostFree instead"))); +inline static hipError_t hipFreeHost(void* ptr) + __attribute__((deprecated("use hipHostFree instead"))); inline static hipError_t hipFreeHost(void* ptr) { return hipCUDAErrorTohipError(cudaFreeHost(ptr)); } -inline static hipError_t hipHostFree(void* ptr) { +inline static hipError_t hipHostFree(void* ptr) { return hipCUDAErrorTohipError(cudaFreeHost(ptr)); } @@ -387,232 +433,252 @@ inline static hipError_t hipSetDevice(int device) { return hipCUDAErrorTohipError(cudaSetDevice(device)); } -inline static hipError_t hipChooseDevice( int* device, const hipDeviceProp_t* prop ) -{ +inline static hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop) { struct cudaDeviceProp cdprop; - memset(&cdprop,0x0,sizeof(struct cudaDeviceProp)); - cdprop.major= prop->major; + memset(&cdprop, 0x0, sizeof(struct cudaDeviceProp)); + cdprop.major = prop->major; cdprop.minor = prop->minor; - cdprop.totalGlobalMem = prop->totalGlobalMem ; + cdprop.totalGlobalMem = prop->totalGlobalMem; cdprop.sharedMemPerBlock = prop->sharedMemPerBlock; cdprop.regsPerBlock = prop->regsPerBlock; - cdprop.warpSize = prop->warpSize ; - cdprop.maxThreadsPerBlock = prop->maxThreadsPerBlock ; + cdprop.warpSize = prop->warpSize; + cdprop.maxThreadsPerBlock = prop->maxThreadsPerBlock; cdprop.clockRate = prop->clockRate; - cdprop.totalConstMem = prop->totalConstMem ; - cdprop.multiProcessorCount = prop->multiProcessorCount ; - cdprop.l2CacheSize = prop->l2CacheSize ; - cdprop.maxThreadsPerMultiProcessor = prop->maxThreadsPerMultiProcessor ; - cdprop.computeMode = prop->computeMode ; + cdprop.totalConstMem = prop->totalConstMem; + cdprop.multiProcessorCount = prop->multiProcessorCount; + cdprop.l2CacheSize = prop->l2CacheSize; + cdprop.maxThreadsPerMultiProcessor = prop->maxThreadsPerMultiProcessor; + cdprop.computeMode = prop->computeMode; cdprop.canMapHostMemory = prop->canMapHostMemory; cdprop.memoryClockRate = prop->memoryClockRate; cdprop.memoryBusWidth = prop->memoryBusWidth; - return hipCUDAErrorTohipError(cudaChooseDevice(device,&cdprop)); + return hipCUDAErrorTohipError(cudaChooseDevice(device, &cdprop)); } -inline static hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, - void* src, size_t size) -{ +inline static hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t size) { return hipCUResultTohipError(cuMemcpyHtoD(dst, src, size)); } -inline static hipError_t hipMemcpyDtoH(void* dst, - hipDeviceptr_t src, size_t size) -{ +inline static hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t size) { return hipCUResultTohipError(cuMemcpyDtoH(dst, src, size)); } -inline static hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, - hipDeviceptr_t src, size_t size) -{ +inline static hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t size) { return hipCUResultTohipError(cuMemcpyDtoD(dst, src, size)); } -inline static hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, - void* src, size_t size, hipStream_t stream) -{ +inline static hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t size, + hipStream_t stream) { return hipCUResultTohipError(cuMemcpyHtoDAsync(dst, src, size, stream)); } -inline static hipError_t hipMemcpyDtoHAsync(void* dst, - hipDeviceptr_t src, size_t size, hipStream_t stream) -{ +inline static hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t size, + hipStream_t stream) { return hipCUResultTohipError(cuMemcpyDtoHAsync(dst, src, size, stream)); } -inline static hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, - hipDeviceptr_t src, size_t size, hipStream_t stream) -{ +inline static hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t size, + hipStream_t stream) { return hipCUResultTohipError(cuMemcpyDtoDAsync(dst, src, size, stream)); } -inline static hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind copyKind) { - return hipCUDAErrorTohipError(cudaMemcpy(dst, src, sizeBytes, hipMemcpyKindToCudaMemcpyKind(copyKind))); +inline static hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, + hipMemcpyKind copyKind) { + return hipCUDAErrorTohipError( + cudaMemcpy(dst, src, sizeBytes, hipMemcpyKindToCudaMemcpyKind(copyKind))); } -inline static hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind copyKind, hipStream_t stream __dparm(0)) { - return hipCUDAErrorTohipError(cudaMemcpyAsync(dst, src, sizeBytes, hipMemcpyKindToCudaMemcpyKind(copyKind), stream)); +inline static hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, + hipMemcpyKind copyKind, hipStream_t stream __dparm(0)) { + return hipCUDAErrorTohipError( + cudaMemcpyAsync(dst, src, sizeBytes, hipMemcpyKindToCudaMemcpyKind(copyKind), stream)); } -inline static hipError_t hipMemcpyToSymbol(const void* symbol, const void* src, size_t sizeBytes, size_t offset __dparm(0), hipMemcpyKind copyType __dparm(hipMemcpyHostToDevice)) { - return hipCUDAErrorTohipError(cudaMemcpyToSymbol(symbol, src, sizeBytes, offset, hipMemcpyKindToCudaMemcpyKind(copyType))); +inline static hipError_t hipMemcpyToSymbol(const void* symbol, const void* src, size_t sizeBytes, + size_t offset __dparm(0), + hipMemcpyKind copyType __dparm(hipMemcpyHostToDevice)) { + return hipCUDAErrorTohipError(cudaMemcpyToSymbol(symbol, src, sizeBytes, offset, + hipMemcpyKindToCudaMemcpyKind(copyType))); } -inline static hipError_t hipMemcpyToSymbolAsync(const void* symbol, const void* src, size_t sizeBytes, size_t offset, hipMemcpyKind copyType, hipStream_t stream __dparm(0)) { - return hipCUDAErrorTohipError(cudaMemcpyToSymbolAsync(symbol, src, sizeBytes, offset, hipMemcpyKindToCudaMemcpyKind(copyType), stream)); +inline static hipError_t hipMemcpyToSymbolAsync(const void* symbol, const void* src, + size_t sizeBytes, size_t offset, + hipMemcpyKind copyType, + hipStream_t stream __dparm(0)) { + return hipCUDAErrorTohipError(cudaMemcpyToSymbolAsync( + symbol, src, sizeBytes, offset, hipMemcpyKindToCudaMemcpyKind(copyType), stream)); } -inline static hipError_t hipMemcpyFromSymbol(void *dst, const void* symbolName, size_t sizeBytes, size_t offset __dparm(0), hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) -{ - return hipCUDAErrorTohipError(cudaMemcpyFromSymbol(dst, symbolName, sizeBytes, offset, hipMemcpyKindToCudaMemcpyKind(kind))); +inline static hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName, size_t sizeBytes, + size_t offset __dparm(0), + hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) { + return hipCUDAErrorTohipError(cudaMemcpyFromSymbol(dst, symbolName, sizeBytes, offset, + hipMemcpyKindToCudaMemcpyKind(kind))); } -inline static hipError_t hipMemcpyFromSymbolAsync(void *dst, const void* symbolName, size_t sizeBytes, size_t offset, hipMemcpyKind kind, hipStream_t stream __dparm(0)) -{ - return hipCUDAErrorTohipError(cudaMemcpyFromSymbolAsync(dst, symbolName, sizeBytes, offset, hipMemcpyKindToCudaMemcpyKind(kind), stream)); +inline static hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName, + size_t sizeBytes, size_t offset, + hipMemcpyKind kind, + hipStream_t stream __dparm(0)) { + return hipCUDAErrorTohipError(cudaMemcpyFromSymbolAsync( + dst, symbolName, sizeBytes, offset, hipMemcpyKindToCudaMemcpyKind(kind), stream)); } -inline static hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind){ - return hipCUDAErrorTohipError(cudaMemcpy2D(dst, dpitch, src, spitch, width, height, hipMemcpyKindToCudaMemcpyKind(kind))); +inline static hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, + size_t width, size_t height, hipMemcpyKind kind) { + return hipCUDAErrorTohipError( + cudaMemcpy2D(dst, dpitch, src, spitch, width, height, hipMemcpyKindToCudaMemcpyKind(kind))); } -inline static hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream) { - return hipCUDAErrorTohipError(cudaMemcpy2DAsync(dst, dpitch, src, spitch, width, height, hipMemcpyKindToCudaMemcpyKind(kind),stream)); +inline static hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, + size_t width, size_t height, hipMemcpyKind kind, + hipStream_t stream) { + return hipCUDAErrorTohipError(cudaMemcpy2DAsync(dst, dpitch, src, spitch, width, height, + hipMemcpyKindToCudaMemcpyKind(kind), stream)); } -inline static hipError_t hipMemcpy2DToArray(hipArray *dst, size_t wOffset, size_t hOffset, const void* src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind){ - return hipCUDAErrorTohipError(cudaMemcpy2DToArray(dst, wOffset, hOffset, src, spitch, width, height, hipMemcpyKindToCudaMemcpyKind(kind))); +inline static hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, + const void* src, size_t spitch, size_t width, + size_t height, hipMemcpyKind kind) { + return hipCUDAErrorTohipError(cudaMemcpy2DToArray(dst, wOffset, hOffset, src, spitch, width, + height, hipMemcpyKindToCudaMemcpyKind(kind))); } -inline static hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src, size_t count, hipMemcpyKind kind) { - return hipCUDAErrorTohipError(cudaMemcpyToArray(dst, wOffset, hOffset, src, count, hipMemcpyKindToCudaMemcpyKind(kind))); +inline static hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, + const void* src, size_t count, hipMemcpyKind kind) { + return hipCUDAErrorTohipError( + cudaMemcpyToArray(dst, wOffset, hOffset, src, count, hipMemcpyKindToCudaMemcpyKind(kind))); } -inline static hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset, size_t count, hipMemcpyKind kind) { - return hipCUDAErrorTohipError(cudaMemcpyFromArray(dst, srcArray, wOffset, hOffset, count, hipMemcpyKindToCudaMemcpyKind(kind))); +inline static hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, + size_t hOffset, size_t count, hipMemcpyKind kind) { + return hipCUDAErrorTohipError(cudaMemcpyFromArray(dst, srcArray, wOffset, hOffset, count, + hipMemcpyKindToCudaMemcpyKind(kind))); } -inline static hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t count) { - return hipCUResultTohipError(cuMemcpyAtoH(dst, (CUarray)srcArray, srcOffset, count)); +inline static hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, + size_t count) { + return hipCUResultTohipError(cuMemcpyAtoH(dst, (CUarray)srcArray, srcOffset, count)); } -inline static hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, size_t count) { - return hipCUResultTohipError(cuMemcpyHtoA((CUarray)dstArray, dstOffset, srcHost, count)); +inline static hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, + size_t count) { + return hipCUResultTohipError(cuMemcpyHtoA((CUarray)dstArray, dstOffset, srcHost, count)); } inline static hipError_t hipDeviceSynchronize() { return hipCUDAErrorTohipError(cudaDeviceSynchronize()); } -inline static hipError_t hipDeviceGetCacheConfig(hipFuncCache_t *pCacheConfig) { +inline static hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* pCacheConfig) { return hipCUDAErrorTohipError(cudaDeviceGetCacheConfig(pCacheConfig)); } -inline static const char* hipGetErrorString(hipError_t error){ +inline static const char* hipGetErrorString(hipError_t error) { return cudaGetErrorString(hipErrorToCudaError(error)); } -inline static const char* hipGetErrorName(hipError_t error){ +inline static const char* hipGetErrorName(hipError_t error) { return cudaGetErrorName(hipErrorToCudaError(error)); } -inline static hipError_t hipGetDeviceCount(int * count){ +inline static hipError_t hipGetDeviceCount(int* count) { return hipCUDAErrorTohipError(cudaGetDeviceCount(count)); } -inline static hipError_t hipGetDevice(int * device){ +inline static hipError_t hipGetDevice(int* device) { return hipCUDAErrorTohipError(cudaGetDevice(device)); } -inline static hipError_t hipIpcCloseMemHandle(void *devPtr){ +inline static hipError_t hipIpcCloseMemHandle(void* devPtr) { return hipCUDAErrorTohipError(cudaIpcCloseMemHandle(devPtr)); } -inline static hipError_t hipIpcGetEventHandle(hipIpcEventHandle_t* handle, hipEvent_t event){ +inline static hipError_t hipIpcGetEventHandle(hipIpcEventHandle_t* handle, hipEvent_t event) { return hipCUDAErrorTohipError(cudaIpcGetEventHandle(handle, event)); } -inline static hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr){ +inline static hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr) { return hipCUDAErrorTohipError(cudaIpcGetMemHandle(handle, devPtr)); } -inline static hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle){ +inline static hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle) { return hipCUDAErrorTohipError(cudaIpcOpenEventHandle(event, handle)); } -inline static hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags){ +inline static hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, + unsigned int flags) { return hipCUDAErrorTohipError(cudaIpcOpenMemHandle(devPtr, handle, flags)); } -inline static hipError_t hipMemset(void* devPtr,int value, size_t count) { +inline static hipError_t hipMemset(void* devPtr, int value, size_t count) { return hipCUDAErrorTohipError(cudaMemset(devPtr, value, count)); } -inline static hipError_t hipMemsetAsync(void* devPtr,int value, size_t count, hipStream_t stream __dparm(0)) { +inline static hipError_t hipMemsetAsync(void* devPtr, int value, size_t count, + hipStream_t stream __dparm(0)) { return hipCUDAErrorTohipError(cudaMemsetAsync(devPtr, value, count, stream)); } -inline static hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t sizeBytes ) -{ +inline static hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t sizeBytes) { return hipCUResultTohipError(cuMemsetD8(dest, value, sizeBytes)); } -inline static hipError_t hipGetDeviceProperties(hipDeviceProp_t *p_prop, int device) -{ - struct cudaDeviceProp cdprop; - cudaError_t cerror; - cerror = cudaGetDeviceProperties(&cdprop,device); - strncpy(p_prop->name,cdprop.name, 256); - p_prop->totalGlobalMem = cdprop.totalGlobalMem ; - p_prop->sharedMemPerBlock = cdprop.sharedMemPerBlock; - p_prop->regsPerBlock = cdprop.regsPerBlock; - p_prop->warpSize = cdprop.warpSize ; - for (int i=0 ; i<3; i++) { - p_prop->maxThreadsDim[i] = cdprop.maxThreadsDim[i]; - p_prop->maxGridSize[i] = cdprop.maxGridSize[i]; - } - p_prop->maxThreadsPerBlock = cdprop.maxThreadsPerBlock ; - p_prop->clockRate = cdprop.clockRate; - p_prop->totalConstMem = cdprop.totalConstMem ; - p_prop->major = cdprop.major ; - p_prop->minor = cdprop. minor ; - p_prop->multiProcessorCount = cdprop.multiProcessorCount ; - p_prop->l2CacheSize = cdprop.l2CacheSize ; - p_prop->maxThreadsPerMultiProcessor = cdprop.maxThreadsPerMultiProcessor ; - p_prop->computeMode = cdprop.computeMode ; - p_prop->canMapHostMemory = cdprop.canMapHostMemory; +inline static hipError_t hipGetDeviceProperties(hipDeviceProp_t* p_prop, int device) { + struct cudaDeviceProp cdprop; + cudaError_t cerror; + cerror = cudaGetDeviceProperties(&cdprop, device); + strncpy(p_prop->name, cdprop.name, 256); + p_prop->totalGlobalMem = cdprop.totalGlobalMem; + p_prop->sharedMemPerBlock = cdprop.sharedMemPerBlock; + p_prop->regsPerBlock = cdprop.regsPerBlock; + p_prop->warpSize = cdprop.warpSize; + for (int i = 0; i < 3; i++) { + p_prop->maxThreadsDim[i] = cdprop.maxThreadsDim[i]; + p_prop->maxGridSize[i] = cdprop.maxGridSize[i]; + } + p_prop->maxThreadsPerBlock = cdprop.maxThreadsPerBlock; + p_prop->clockRate = cdprop.clockRate; + p_prop->totalConstMem = cdprop.totalConstMem; + p_prop->major = cdprop.major; + p_prop->minor = cdprop.minor; + p_prop->multiProcessorCount = cdprop.multiProcessorCount; + p_prop->l2CacheSize = cdprop.l2CacheSize; + p_prop->maxThreadsPerMultiProcessor = cdprop.maxThreadsPerMultiProcessor; + p_prop->computeMode = cdprop.computeMode; + p_prop->canMapHostMemory = cdprop.canMapHostMemory; p_prop->memoryClockRate = cdprop.memoryClockRate; p_prop->memoryBusWidth = cdprop.memoryBusWidth; - // Same as clock-rate: - p_prop->clockInstructionRate = cdprop.clockRate; + // Same as clock-rate: + p_prop->clockInstructionRate = cdprop.clockRate; - int ccVers = p_prop->major*100 + p_prop->minor * 10; + int ccVers = p_prop->major * 100 + p_prop->minor * 10; - p_prop->arch.hasGlobalInt32Atomics = (ccVers >= 110); - p_prop->arch.hasGlobalFloatAtomicExch = (ccVers >= 110); - p_prop->arch.hasSharedInt32Atomics = (ccVers >= 120); - p_prop->arch.hasSharedFloatAtomicExch = (ccVers >= 120); + p_prop->arch.hasGlobalInt32Atomics = (ccVers >= 110); + p_prop->arch.hasGlobalFloatAtomicExch = (ccVers >= 110); + p_prop->arch.hasSharedInt32Atomics = (ccVers >= 120); + p_prop->arch.hasSharedFloatAtomicExch = (ccVers >= 120); - p_prop->arch.hasFloatAtomicAdd = (ccVers >= 200); + p_prop->arch.hasFloatAtomicAdd = (ccVers >= 200); - p_prop->arch.hasGlobalInt64Atomics = (ccVers >= 120); - p_prop->arch.hasSharedInt64Atomics = (ccVers >= 110); + p_prop->arch.hasGlobalInt64Atomics = (ccVers >= 120); + p_prop->arch.hasSharedInt64Atomics = (ccVers >= 110); - p_prop->arch.hasDoubles = (ccVers >= 130); + p_prop->arch.hasDoubles = (ccVers >= 130); - p_prop->arch.hasWarpVote = (ccVers >= 120); - p_prop->arch.hasWarpBallot = (ccVers >= 200); - p_prop->arch.hasWarpShuffle = (ccVers >= 300); - p_prop->arch.hasFunnelShift = (ccVers >= 350); + p_prop->arch.hasWarpVote = (ccVers >= 120); + p_prop->arch.hasWarpBallot = (ccVers >= 200); + p_prop->arch.hasWarpShuffle = (ccVers >= 300); + p_prop->arch.hasFunnelShift = (ccVers >= 350); - p_prop->arch.hasThreadFenceSystem = (ccVers >= 200); - p_prop->arch.hasSyncThreadsExt = (ccVers >= 200); + p_prop->arch.hasThreadFenceSystem = (ccVers >= 200); + p_prop->arch.hasSyncThreadsExt = (ccVers >= 200); - p_prop->arch.hasSurfaceFuncs = (ccVers >= 200); - p_prop->arch.has3dGrid = (ccVers >= 200); - p_prop->arch.hasDynamicParallelism = (ccVers >= 350); + p_prop->arch.hasSurfaceFuncs = (ccVers >= 200); + p_prop->arch.has3dGrid = (ccVers >= 200); + p_prop->arch.hasDynamicParallelism = (ccVers >= 350); p_prop->concurrentKernels = cdprop.concurrentKernels; p_prop->pciBusID = cdprop.pciBusID; @@ -623,64 +689,89 @@ inline static hipError_t hipGetDeviceProperties(hipDeviceProp_t *p_prop, int dev return hipCUDAErrorTohipError(cerror); } -inline static hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device) -{ +inline static hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device) { enum cudaDeviceAttr cdattr; cudaError_t cerror; switch (attr) { - case hipDeviceAttributeMaxThreadsPerBlock: - cdattr = cudaDevAttrMaxThreadsPerBlock; break; - case hipDeviceAttributeMaxBlockDimX: - cdattr = cudaDevAttrMaxBlockDimX; break; - case hipDeviceAttributeMaxBlockDimY: - cdattr = cudaDevAttrMaxBlockDimY; break; - case hipDeviceAttributeMaxBlockDimZ: - cdattr = cudaDevAttrMaxBlockDimZ; break; - case hipDeviceAttributeMaxGridDimX: - cdattr = cudaDevAttrMaxGridDimX; break; - case hipDeviceAttributeMaxGridDimY: - cdattr = cudaDevAttrMaxGridDimY; break; - case hipDeviceAttributeMaxGridDimZ: - cdattr = cudaDevAttrMaxGridDimZ; break; - case hipDeviceAttributeMaxSharedMemoryPerBlock: - cdattr = cudaDevAttrMaxSharedMemoryPerBlock; break; - case hipDeviceAttributeTotalConstantMemory: - cdattr = cudaDevAttrTotalConstantMemory; break; - case hipDeviceAttributeWarpSize: - cdattr = cudaDevAttrWarpSize; break; - case hipDeviceAttributeMaxRegistersPerBlock: - cdattr = cudaDevAttrMaxRegistersPerBlock; break; - case hipDeviceAttributeClockRate: - cdattr = cudaDevAttrClockRate; break; - case hipDeviceAttributeMemoryClockRate: - cdattr = cudaDevAttrMemoryClockRate; break; - case hipDeviceAttributeMemoryBusWidth: - cdattr = cudaDevAttrGlobalMemoryBusWidth; break; - case hipDeviceAttributeMultiprocessorCount: - cdattr = cudaDevAttrMultiProcessorCount; break; - case hipDeviceAttributeComputeMode: - cdattr = cudaDevAttrComputeMode; break; - case hipDeviceAttributeL2CacheSize: - cdattr = cudaDevAttrL2CacheSize; break; - case hipDeviceAttributeMaxThreadsPerMultiProcessor: - cdattr = cudaDevAttrMaxThreadsPerMultiProcessor; break; - case hipDeviceAttributeComputeCapabilityMajor: - cdattr = cudaDevAttrComputeCapabilityMajor; break; - case hipDeviceAttributeComputeCapabilityMinor: - cdattr = cudaDevAttrComputeCapabilityMinor; break; - case hipDeviceAttributeConcurrentKernels: - cdattr = cudaDevAttrConcurrentKernels; break; - case hipDeviceAttributePciBusId: - cdattr = cudaDevAttrPciBusId; break; - case hipDeviceAttributePciDeviceId: - cdattr = cudaDevAttrPciDeviceId; break; - case hipDeviceAttributeMaxSharedMemoryPerMultiprocessor: - cdattr = cudaDevAttrMaxSharedMemoryPerMultiprocessor; break; - case hipDeviceAttributeIsMultiGpuBoard: - cdattr = cudaDevAttrIsMultiGpuBoard; break; - default: - cerror = cudaErrorInvalidValue; break; + case hipDeviceAttributeMaxThreadsPerBlock: + cdattr = cudaDevAttrMaxThreadsPerBlock; + break; + case hipDeviceAttributeMaxBlockDimX: + cdattr = cudaDevAttrMaxBlockDimX; + break; + case hipDeviceAttributeMaxBlockDimY: + cdattr = cudaDevAttrMaxBlockDimY; + break; + case hipDeviceAttributeMaxBlockDimZ: + cdattr = cudaDevAttrMaxBlockDimZ; + break; + case hipDeviceAttributeMaxGridDimX: + cdattr = cudaDevAttrMaxGridDimX; + break; + case hipDeviceAttributeMaxGridDimY: + cdattr = cudaDevAttrMaxGridDimY; + break; + case hipDeviceAttributeMaxGridDimZ: + cdattr = cudaDevAttrMaxGridDimZ; + break; + case hipDeviceAttributeMaxSharedMemoryPerBlock: + cdattr = cudaDevAttrMaxSharedMemoryPerBlock; + break; + case hipDeviceAttributeTotalConstantMemory: + cdattr = cudaDevAttrTotalConstantMemory; + break; + case hipDeviceAttributeWarpSize: + cdattr = cudaDevAttrWarpSize; + break; + case hipDeviceAttributeMaxRegistersPerBlock: + cdattr = cudaDevAttrMaxRegistersPerBlock; + break; + case hipDeviceAttributeClockRate: + cdattr = cudaDevAttrClockRate; + break; + case hipDeviceAttributeMemoryClockRate: + cdattr = cudaDevAttrMemoryClockRate; + break; + case hipDeviceAttributeMemoryBusWidth: + cdattr = cudaDevAttrGlobalMemoryBusWidth; + break; + case hipDeviceAttributeMultiprocessorCount: + cdattr = cudaDevAttrMultiProcessorCount; + break; + case hipDeviceAttributeComputeMode: + cdattr = cudaDevAttrComputeMode; + break; + case hipDeviceAttributeL2CacheSize: + cdattr = cudaDevAttrL2CacheSize; + break; + case hipDeviceAttributeMaxThreadsPerMultiProcessor: + cdattr = cudaDevAttrMaxThreadsPerMultiProcessor; + break; + case hipDeviceAttributeComputeCapabilityMajor: + cdattr = cudaDevAttrComputeCapabilityMajor; + break; + case hipDeviceAttributeComputeCapabilityMinor: + cdattr = cudaDevAttrComputeCapabilityMinor; + break; + case hipDeviceAttributeConcurrentKernels: + cdattr = cudaDevAttrConcurrentKernels; + break; + case hipDeviceAttributePciBusId: + cdattr = cudaDevAttrPciBusId; + break; + case hipDeviceAttributePciDeviceId: + cdattr = cudaDevAttrPciDeviceId; + break; + case hipDeviceAttributeMaxSharedMemoryPerMultiprocessor: + cdattr = cudaDevAttrMaxSharedMemoryPerMultiprocessor; + break; + case hipDeviceAttributeIsMultiGpuBoard: + cdattr = cudaDevAttrIsMultiGpuBoard; + break; + default: + cerror = cudaErrorInvalidValue; + break; } cerror = cudaDeviceGetAttribute(pi, cdattr, device); @@ -688,381 +779,324 @@ inline static hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t att return hipCUDAErrorTohipError(cerror); } -inline static hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor( - int *numBlocks, - const void* func, - int blockSize, - size_t dynamicSMemSize - ) -{ +inline static hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, + const void* func, + int blockSize, + size_t dynamicSMemSize) { cudaError_t cerror; - cerror = cudaOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize); + cerror = + cudaOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize); return hipCUDAErrorTohipError(cerror); } -inline static hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, void* ptr){ - struct cudaPointerAttributes cPA; - hipError_t err = hipCUDAErrorTohipError(cudaPointerGetAttributes(&cPA, ptr)); - if(err == hipSuccess){ - switch (cPA.memoryType){ - case cudaMemoryTypeDevice: - attributes->memoryType = hipMemoryTypeDevice; break; - case cudaMemoryTypeHost: - attributes->memoryType = hipMemoryTypeHost; break; - default: - return hipErrorUnknown; - } - attributes->device = cPA.device; - attributes->devicePointer = cPA.devicePointer; - attributes->hostPointer = cPA.hostPointer; - attributes->isManaged = 0; - attributes->allocationFlags = 0; - } - return err; +inline static hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, void* ptr) { + struct cudaPointerAttributes cPA; + hipError_t err = hipCUDAErrorTohipError(cudaPointerGetAttributes(&cPA, ptr)); + if (err == hipSuccess) { + switch (cPA.memoryType) { + case cudaMemoryTypeDevice: + attributes->memoryType = hipMemoryTypeDevice; + break; + case cudaMemoryTypeHost: + attributes->memoryType = hipMemoryTypeHost; + break; + default: + return hipErrorUnknown; + } + attributes->device = cPA.device; + attributes->devicePointer = cPA.devicePointer; + attributes->hostPointer = cPA.hostPointer; + attributes->isManaged = 0; + attributes->allocationFlags = 0; + } + return err; } -inline static hipError_t hipMemGetInfo( size_t* free, size_t* total) -{ - return hipCUDAErrorTohipError(cudaMemGetInfo(free,total)); +inline static hipError_t hipMemGetInfo(size_t* free, size_t* total) { + return hipCUDAErrorTohipError(cudaMemGetInfo(free, total)); } -inline static hipError_t hipEventCreate( hipEvent_t* event) -{ +inline static hipError_t hipEventCreate(hipEvent_t* event) { return hipCUDAErrorTohipError(cudaEventCreate(event)); } -inline static hipError_t hipEventRecord( hipEvent_t event, hipStream_t stream __dparm(NULL)) -{ - return hipCUDAErrorTohipError(cudaEventRecord(event,stream)); +inline static hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream __dparm(NULL)) { + return hipCUDAErrorTohipError(cudaEventRecord(event, stream)); } -inline static hipError_t hipEventSynchronize( hipEvent_t event) -{ +inline static hipError_t hipEventSynchronize(hipEvent_t event) { return hipCUDAErrorTohipError(cudaEventSynchronize(event)); } -inline static hipError_t hipEventElapsedTime( float *ms, hipEvent_t start, hipEvent_t stop) -{ - return hipCUDAErrorTohipError(cudaEventElapsedTime(ms,start,stop)); +inline static hipError_t hipEventElapsedTime(float* ms, hipEvent_t start, hipEvent_t stop) { + return hipCUDAErrorTohipError(cudaEventElapsedTime(ms, start, stop)); } -inline static hipError_t hipEventDestroy( hipEvent_t event) -{ +inline static hipError_t hipEventDestroy(hipEvent_t event) { return hipCUDAErrorTohipError(cudaEventDestroy(event)); } -inline static hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags) -{ +inline static hipError_t hipStreamCreateWithFlags(hipStream_t* stream, unsigned int flags) { return hipCUDAErrorTohipError(cudaStreamCreateWithFlags(stream, flags)); } -inline static hipError_t hipStreamCreate(hipStream_t *stream) -{ +inline static hipError_t hipStreamCreate(hipStream_t* stream) { return hipCUDAErrorTohipError(cudaStreamCreate(stream)); } -inline static hipError_t hipStreamSynchronize(hipStream_t stream) -{ +inline static hipError_t hipStreamSynchronize(hipStream_t stream) { return hipCUDAErrorTohipError(cudaStreamSynchronize(stream)); } -inline static hipError_t hipStreamDestroy(hipStream_t stream) -{ +inline static hipError_t hipStreamDestroy(hipStream_t stream) { return hipCUDAErrorTohipError(cudaStreamDestroy(stream)); } -inline static hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags) -{ +inline static hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, + unsigned int flags) { return hipCUDAErrorTohipError(cudaStreamWaitEvent(stream, event, flags)); } -inline static hipError_t hipStreamQuery(hipStream_t stream) -{ +inline static hipError_t hipStreamQuery(hipStream_t stream) { return hipCUDAErrorTohipError(cudaStreamQuery(stream)); } -inline static hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void *userData, unsigned int flags) -{ - return hipCUDAErrorTohipError(cudaStreamAddCallback(stream, (cudaStreamCallback_t)callback, userData, flags)); +inline static hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, + void* userData, unsigned int flags) { + return hipCUDAErrorTohipError( + cudaStreamAddCallback(stream, (cudaStreamCallback_t)callback, userData, flags)); } -inline static hipError_t hipDriverGetVersion(int *driverVersion) -{ - cudaError_t err = cudaDriverGetVersion(driverVersion); +inline static hipError_t hipDriverGetVersion(int* driverVersion) { + cudaError_t err = cudaDriverGetVersion(driverVersion); - // Override driver version to match version reported on HCC side. + // Override driver version to match version reported on HCC side. *driverVersion = 4; - return hipCUDAErrorTohipError(err); + return hipCUDAErrorTohipError(err); } -inline static hipError_t hipRuntimeGetVersion(int *runtimeVersion) -{ +inline static hipError_t hipRuntimeGetVersion(int* runtimeVersion) { return hipCUDAErrorTohipError(cudaRuntimeGetVersion(runtimeVersion)); } -inline static hipError_t hipDeviceCanAccessPeer ( int* canAccessPeer, int device, int peerDevice ) -{ +inline static hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int device, int peerDevice) { return hipCUDAErrorTohipError(cudaDeviceCanAccessPeer(canAccessPeer, device, peerDevice)); } -inline static hipError_t hipDeviceDisablePeerAccess ( int peerDevice ) -{ +inline static hipError_t hipDeviceDisablePeerAccess(int peerDevice) { return hipCUDAErrorTohipError(cudaDeviceDisablePeerAccess(peerDevice)); } -inline static hipError_t hipDeviceEnablePeerAccess ( int peerDevice, unsigned int flags ) -{ +inline static hipError_t hipDeviceEnablePeerAccess(int peerDevice, unsigned int flags) { return hipCUDAErrorTohipError(cudaDeviceEnablePeerAccess(peerDevice, flags)); } -inline static hipError_t hipCtxDisablePeerAccess ( hipCtx_t peerCtx ) -{ - return hipCUResultTohipError(cuCtxDisablePeerAccess ( peerCtx )); +inline static hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx) { + return hipCUResultTohipError(cuCtxDisablePeerAccess(peerCtx)); } -inline static hipError_t hipCtxEnablePeerAccess ( hipCtx_t peerCtx, unsigned int flags ) -{ +inline static hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags) { return hipCUResultTohipError(cuCtxEnablePeerAccess(peerCtx, flags)); } -inline static hipError_t hipDevicePrimaryCtxGetState ( hipDevice_t dev, unsigned int* flags, int* active ) -{ +inline static hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, + int* active) { return hipCUResultTohipError(cuDevicePrimaryCtxGetState(dev, flags, active)); } -inline static hipError_t hipDevicePrimaryCtxRelease ( hipDevice_t dev) -{ +inline static hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev) { return hipCUResultTohipError(cuDevicePrimaryCtxRelease(dev)); } -inline static hipError_t hipDevicePrimaryCtxRetain ( hipCtx_t* pctx, hipDevice_t dev ) -{ +inline static hipError_t hipDevicePrimaryCtxRetain(hipCtx_t* pctx, hipDevice_t dev) { return hipCUResultTohipError(cuDevicePrimaryCtxRetain(pctx, dev)); } -inline static hipError_t hipDevicePrimaryCtxReset ( hipDevice_t dev ) -{ +inline static hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev) { return hipCUResultTohipError(cuDevicePrimaryCtxReset(dev)); } -inline static hipError_t hipDevicePrimaryCtxSetFlags ( hipDevice_t dev, unsigned int flags ) -{ +inline static hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags) { return hipCUResultTohipError(cuDevicePrimaryCtxSetFlags(dev, flags)); } -inline static hipError_t hipMemGetAddressRange ( hipDeviceptr_t* pbase, size_t* psize, hipDeviceptr_t dptr ) -{ - return hipCUResultTohipError(cuMemGetAddressRange( pbase , psize , dptr)); +inline static hipError_t hipMemGetAddressRange(hipDeviceptr_t* pbase, size_t* psize, + hipDeviceptr_t dptr) { + return hipCUResultTohipError(cuMemGetAddressRange(pbase, psize, dptr)); } -inline static hipError_t hipMemcpyPeer ( void* dst, int dstDevice, const void* src, int srcDevice, size_t count ) -{ +inline static hipError_t hipMemcpyPeer(void* dst, int dstDevice, const void* src, int srcDevice, + size_t count) { return hipCUDAErrorTohipError(cudaMemcpyPeer(dst, dstDevice, src, srcDevice, count)); } -inline static hipError_t hipMemcpyPeerAsync ( void* dst, int dstDevice, const void* src, int srcDevice, size_t count, hipStream_t stream __dparm(0)) -{ - return hipCUDAErrorTohipError(cudaMemcpyPeerAsync(dst, dstDevice, src, srcDevice, count, stream)); +inline static hipError_t hipMemcpyPeerAsync(void* dst, int dstDevice, const void* src, + int srcDevice, size_t count, + hipStream_t stream __dparm(0)) { + return hipCUDAErrorTohipError( + cudaMemcpyPeerAsync(dst, dstDevice, src, srcDevice, count, stream)); } // Profile APIs: -inline static hipError_t hipProfilerStart() -{ - return hipCUDAErrorTohipError(cudaProfilerStart()); -} +inline static hipError_t hipProfilerStart() { return hipCUDAErrorTohipError(cudaProfilerStart()); } -inline static hipError_t hipProfilerStop() -{ - return hipCUDAErrorTohipError(cudaProfilerStop()); -} +inline static hipError_t hipProfilerStop() { return hipCUDAErrorTohipError(cudaProfilerStop()); } -inline static hipError_t hipSetDeviceFlags (unsigned int flags) -{ +inline static hipError_t hipSetDeviceFlags(unsigned int flags) { return hipCUDAErrorTohipError(cudaSetDeviceFlags(flags)); } -inline static hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned int flags) -{ - return hipCUDAErrorTohipError(cudaEventCreateWithFlags(event, flags)); +inline static hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned int flags) { + return hipCUDAErrorTohipError(cudaEventCreateWithFlags(event, flags)); } -inline static hipError_t hipEventQuery(hipEvent_t event) -{ - return hipCUDAErrorTohipError(cudaEventQuery(event)); +inline static hipError_t hipEventQuery(hipEvent_t event) { + return hipCUDAErrorTohipError(cudaEventQuery(event)); } -inline static hipError_t hipCtxCreate(hipCtx_t *ctx, unsigned int flags, hipDevice_t device) -{ - return hipCUResultTohipError(cuCtxCreate(ctx,flags,device)); +inline static hipError_t hipCtxCreate(hipCtx_t* ctx, unsigned int flags, hipDevice_t device) { + return hipCUResultTohipError(cuCtxCreate(ctx, flags, device)); } -inline static hipError_t hipCtxDestroy(hipCtx_t ctx) -{ +inline static hipError_t hipCtxDestroy(hipCtx_t ctx) { return hipCUResultTohipError(cuCtxDestroy(ctx)); } -inline static hipError_t hipCtxPopCurrent(hipCtx_t* ctx) -{ +inline static hipError_t hipCtxPopCurrent(hipCtx_t* ctx) { return hipCUResultTohipError(cuCtxPopCurrent(ctx)); } -inline static hipError_t hipCtxPushCurrent(hipCtx_t ctx) -{ +inline static hipError_t hipCtxPushCurrent(hipCtx_t ctx) { return hipCUResultTohipError(cuCtxPushCurrent(ctx)); } -inline static hipError_t hipCtxSetCurrent(hipCtx_t ctx) -{ +inline static hipError_t hipCtxSetCurrent(hipCtx_t ctx) { return hipCUResultTohipError(cuCtxSetCurrent(ctx)); } -inline static hipError_t hipCtxGetCurrent(hipCtx_t* ctx) -{ +inline static hipError_t hipCtxGetCurrent(hipCtx_t* ctx) { return hipCUResultTohipError(cuCtxGetCurrent(ctx)); } -inline static hipError_t hipCtxGetDevice(hipDevice_t *device) -{ +inline static hipError_t hipCtxGetDevice(hipDevice_t* device) { return hipCUResultTohipError(cuCtxGetDevice(device)); } -inline static hipError_t hipCtxGetApiVersion (hipCtx_t ctx,int *apiVersion) -{ - return hipCUResultTohipError(cuCtxGetApiVersion(ctx,(unsigned int*)apiVersion)); +inline static hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int* apiVersion) { + return hipCUResultTohipError(cuCtxGetApiVersion(ctx, (unsigned int*)apiVersion)); } -inline static hipError_t hipCtxGetCacheConfig (hipFuncCache *cacheConfig) -{ +inline static hipError_t hipCtxGetCacheConfig(hipFuncCache* cacheConfig) { return hipCUResultTohipError(cuCtxGetCacheConfig(cacheConfig)); } -inline static hipError_t hipCtxSetCacheConfig (hipFuncCache cacheConfig) -{ +inline static hipError_t hipCtxSetCacheConfig(hipFuncCache cacheConfig) { return hipCUResultTohipError(cuCtxSetCacheConfig(cacheConfig)); } -inline static hipError_t hipCtxSetSharedMemConfig (hipSharedMemConfig config) -{ +inline static hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config) { return hipCUResultTohipError(cuCtxSetSharedMemConfig((CUsharedconfig)config)); } -inline static hipError_t hipCtxGetSharedMemConfig ( hipSharedMemConfig * pConfig ) -{ - return hipCUResultTohipError(cuCtxGetSharedMemConfig((CUsharedconfig *)pConfig)); +inline static hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig* pConfig) { + return hipCUResultTohipError(cuCtxGetSharedMemConfig((CUsharedconfig*)pConfig)); } -inline static hipError_t hipCtxSynchronize ( void ) -{ - return hipCUResultTohipError(cuCtxSynchronize ( )); +inline static hipError_t hipCtxSynchronize(void) { + return hipCUResultTohipError(cuCtxSynchronize()); } -inline static hipError_t hipCtxGetFlags ( unsigned int* flags ) -{ +inline static hipError_t hipCtxGetFlags(unsigned int* flags) { return hipCUResultTohipError(cuCtxGetFlags(flags)); } -inline static hipError_t hipCtxDetach(hipCtx_t ctx) -{ +inline static hipError_t hipCtxDetach(hipCtx_t ctx) { return hipCUResultTohipError(cuCtxDetach(ctx)); } -inline static hipError_t hipDeviceGet(hipDevice_t *device, int ordinal) -{ +inline static hipError_t hipDeviceGet(hipDevice_t* device, int ordinal) { return hipCUResultTohipError(cuDeviceGet(device, ordinal)); } -inline static hipError_t hipDeviceComputeCapability(int *major, int *minor, hipDevice_t device) -{ - return hipCUResultTohipError(cuDeviceComputeCapability(major,minor,device)); +inline static hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device) { + return hipCUResultTohipError(cuDeviceComputeCapability(major, minor, device)); } -inline static hipError_t hipDeviceGetName(char *name,int len,hipDevice_t device) -{ - return hipCUResultTohipError(cuDeviceGetName(name,len,device)); +inline static hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device) { + return hipCUResultTohipError(cuDeviceGetName(name, len, device)); } -inline static hipError_t hipDeviceGetPCIBusId(char* pciBusId,int len,hipDevice_t device) -{ - return hipCUDAErrorTohipError(cudaDeviceGetPCIBusId(pciBusId,len,device)); +inline static hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, hipDevice_t device) { + return hipCUDAErrorTohipError(cudaDeviceGetPCIBusId(pciBusId, len, device)); } -inline static hipError_t hipDeviceGetByPCIBusId(int* device, const char *pciBusId) -{ +inline static hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId) { return hipCUDAErrorTohipError(cudaDeviceGetByPCIBusId(device, pciBusId)); } -inline static hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig *config) -{ +inline static hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig* config) { return hipCUDAErrorTohipError(cudaDeviceGetSharedMemConfig(config)); } - -inline static hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config) -{ + +inline static hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config) { return hipCUDAErrorTohipError(cudaDeviceSetSharedMemConfig(config)); } -inline static hipError_t hipDeviceGetLimit(size_t *pValue, hipLimit_t limit) -{ +inline static hipError_t hipDeviceGetLimit(size_t* pValue, hipLimit_t limit) { return hipCUDAErrorTohipError(cudaDeviceGetLimit(pValue, limit)); } -inline static hipError_t hipDeviceTotalMem(size_t *bytes,hipDevice_t device) -{ - return hipCUResultTohipError(cuDeviceTotalMem(bytes,device)); +inline static hipError_t hipDeviceTotalMem(size_t* bytes, hipDevice_t device) { + return hipCUResultTohipError(cuDeviceTotalMem(bytes, device)); } -inline static hipError_t hipModuleLoad(hipModule_t *module, const char* fname) -{ +inline static hipError_t hipModuleLoad(hipModule_t* module, const char* fname) { return hipCUResultTohipError(cuModuleLoad(module, fname)); } -inline static hipError_t hipModuleUnload(hipModule_t hmod) -{ +inline static hipError_t hipModuleUnload(hipModule_t hmod) { return hipCUResultTohipError(cuModuleUnload(hmod)); } -inline static hipError_t hipModuleGetFunction(hipFunction_t *function, - hipModule_t module, const char *kname) -{ +inline static hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, + const char* kname) { return hipCUResultTohipError(cuModuleGetFunction(function, module, kname)); } -inline static hipError_t hipModuleGetGlobal(hipDeviceptr_t *dptr, size_t *bytes, - hipModule_t hmod, const char* name) -{ +inline static hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes, hipModule_t hmod, + const char* name) { return hipCUResultTohipError(cuModuleGetGlobal(dptr, bytes, hmod, name)); } -inline static hipError_t hipModuleLoadData(hipModule_t *module, const void *image) -{ +inline static hipError_t hipModuleLoadData(hipModule_t* module, const void* image) { return hipCUResultTohipError(cuModuleLoadData(module, image)); } -inline static hipError_t hipModuleLoadDataEx(hipModule_t *module, const void *image, unsigned int numOptions, hipJitOption *options, void **optionValues) -{ - return hipCUResultTohipError(cuModuleLoadDataEx(module, image, numOptions, options, optionValues)); +inline static hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* image, + unsigned int numOptions, hipJitOption* options, + void** optionValues) { + return hipCUResultTohipError( + cuModuleLoadDataEx(module, image, numOptions, options, optionValues)); } -inline static hipError_t hipModuleLaunchKernel(hipFunction_t f, - unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, - unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, - unsigned int sharedMemBytes, hipStream_t stream, - void **kernelParams, void **extra) -{ - return hipCUResultTohipError(cuLaunchKernel(f, - gridDimX, gridDimY, gridDimZ, - blockDimX, blockDimY, blockDimZ, - sharedMemBytes, stream, kernelParams, extra)); +inline static hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, + unsigned int gridDimY, unsigned int gridDimZ, + unsigned int blockDimX, unsigned int blockDimY, + unsigned int blockDimZ, unsigned int sharedMemBytes, + hipStream_t stream, void** kernelParams, + void** extra) { + return hipCUResultTohipError(cuLaunchKernel(f, gridDimX, gridDimY, gridDimZ, blockDimX, + blockDimY, blockDimZ, sharedMemBytes, stream, + kernelParams, extra)); } -inline static hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t cacheConfig) -{ +inline static hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t cacheConfig) { return hipCUDAErrorTohipError(cudaFuncSetCacheConfig(func, cacheConfig)); } @@ -1072,94 +1106,79 @@ inline static hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t #ifdef __CUDACC__ -template -inline static hipError_t hipOccupancyMaxPotentialBlockSize( - int *minGridSize, - int *blockSize, - T func, - size_t dynamicSMemSize = 0, - int blockSizeLimit = 0, - unsigned int flags = 0 - ){ +template +inline static hipError_t hipOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, T func, + size_t dynamicSMemSize = 0, + int blockSizeLimit = 0, + unsigned int flags = 0) { cudaError_t cerror; - cerror = cudaOccupancyMaxPotentialBlockSize(minGridSize, blockSize, func, dynamicSMemSize, blockSizeLimit, flags); + cerror = cudaOccupancyMaxPotentialBlockSize(minGridSize, blockSize, func, dynamicSMemSize, + blockSizeLimit, flags); return hipCUDAErrorTohipError(cerror); } template -inline static hipError_t hipBindTexture(size_t *offset, - const struct texture &tex, - const void *devPtr, - size_t size=UINT_MAX) -{ - return hipCUDAErrorTohipError(cudaBindTexture(offset, tex, devPtr, size)); +inline static hipError_t hipBindTexture(size_t* offset, const struct texture& tex, + const void* devPtr, size_t size = UINT_MAX) { + return hipCUDAErrorTohipError(cudaBindTexture(offset, tex, devPtr, size)); } template -inline static hipError_t hipBindTexture(size_t *offset, - struct texture *tex, - const void *devPtr, - const struct hipChannelFormatDesc *desc, - size_t size=UINT_MAX) -{ - return hipCUDAErrorTohipError(cudaBindTexture(offset, tex, devPtr, desc, size)); +inline static hipError_t hipBindTexture(size_t* offset, struct texture* tex, + const void* devPtr, const struct hipChannelFormatDesc* desc, + size_t size = UINT_MAX) { + return hipCUDAErrorTohipError(cudaBindTexture(offset, tex, devPtr, desc, size)); } template -inline static hipError_t hipUnbindTexture(struct texture *tex) -{ - return hipCUDAErrorTohipError(cudaUnbindTexture(tex)); +inline static hipError_t hipUnbindTexture(struct texture* tex) { + return hipCUDAErrorTohipError(cudaUnbindTexture(tex)); } template inline static hipError_t hipBindTextureToArray(struct texture& tex, - hipArray_const_t array, - const struct hipChannelFormatDesc& desc) -{ - return hipCUDAErrorTohipError(cudaBindTextureToArray(tex, array,desc)); + hipArray_const_t array, + const struct hipChannelFormatDesc& desc) { + return hipCUDAErrorTohipError(cudaBindTextureToArray(tex, array, desc)); } template -inline static hipError_t hipBindTextureToArray(struct texture &tex, - hipArray_const_t array) -{ +inline static hipError_t hipBindTextureToArray(struct texture& tex, + hipArray_const_t array) { return hipCUDAErrorTohipError(cudaBindTextureToArray(tex, array)); } template -inline static hipChannelFormatDesc hipCreateChannelDesc() -{ - return cudaCreateChannelDesc(); +inline static hipChannelFormatDesc hipCreateChannelDesc() { + return cudaCreateChannelDesc(); } -inline static hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, hipChannelFormatKind f) -{ - return cudaCreateChannelDesc(x , y , z , w, hipChannelFormatKindToCudaChannelFormatKind(f)); +inline static hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, + hipChannelFormatKind f) { + return cudaCreateChannelDesc(x, y, z, w, hipChannelFormatKindToCudaChannelFormatKind(f)); } inline static hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, - const hipResourceDesc* pResDesc, - const hipTextureDesc* pTexDesc, - const hipResourceViewDesc* pResViewDesc) -{ - return hipCUDAErrorTohipError(cudaCreateTextureObject(pTexObject, pResDesc, pTexDesc, pResViewDesc)); + const hipResourceDesc* pResDesc, + const hipTextureDesc* pTexDesc, + const hipResourceViewDesc* pResViewDesc) { + return hipCUDAErrorTohipError( + cudaCreateTextureObject(pTexObject, pResDesc, pTexDesc, pResViewDesc)); } -inline static hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject) -{ +inline static hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject) { return hipCUDAErrorTohipError(cudaDestroyTextureObject(textureObject)); } -inline static hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, const hipResourceDesc* pResDesc) -{ +inline static hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, + const hipResourceDesc* pResDesc) { return hipCUDAErrorTohipError(cudaCreateSurfaceObject(pSurfObject, pResDesc)); } -inline static hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject) -{ +inline static hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject) { return hipCUDAErrorTohipError(cudaDestroySurfaceObject(surfaceObject)); } -#endif //__CUDACC__ +#endif //__CUDACC__ -#endif //HIP_INCLUDE_HIP_NVCC_DETAIL_HIP_RUNTIME_API_H +#endif // HIP_INCLUDE_HIP_NVCC_DETAIL_HIP_RUNTIME_API_H diff --git a/hipamd/include/hip/texture_types.h b/hipamd/include/hip/texture_types.h index ca6101cf79..7d785708d4 100644 --- a/hipamd/include/hip/texture_types.h +++ b/hipamd/include/hip/texture_types.h @@ -25,9 +25,9 @@ THE SOFTWARE. #include -#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__) +#if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_PLATFORM_NVCC__) #include -#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__) +#elif defined(__HIP_PLATFORM_NVCC__) && !defined(__HIP_PLATFORM_HCC__) #include "texture_types.h" #else #error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); diff --git a/hipamd/lpl_ca/ca.cpp b/hipamd/lpl_ca/ca.cpp index 485776d427..0ad25c6592 100644 --- a/hipamd/lpl_ca/ca.cpp +++ b/hipamd/lpl_ca/ca.cpp @@ -11,8 +11,7 @@ using namespace clara; using namespace hip_impl; using namespace std; -int main(int argc, char** argv) -{ +int main(int argc, char** argv) { try { bool help = false; vector inputs; @@ -24,7 +23,8 @@ int main(int argc, char** argv) if (!r) throw runtime_error{r.errorMessage()}; - if (help) cout << cmd << endl; + if (help) + cout << cmd << endl; else { if (inputs.empty()) throw runtime_error{"No inputs specified."}; @@ -33,13 +33,12 @@ int main(int argc, char** argv) auto tmp = tokenize_targets(targets); if (tmp.empty()) { tmp.assign(amdgpu_targets().cbegin(), amdgpu_targets().cend()); - } - else validate_targets(tmp); + } else + validate_targets(tmp); extract_code_objects(inputs, tmp); } - } - catch (const exception& ex) { + } catch (const exception& ex) { cerr << ex.what() << endl; return EXIT_FAILURE; diff --git a/hipamd/lpl_ca/ca.hpp b/hipamd/lpl_ca/ca.hpp index 8b2a600d6f..bb1963bede 100644 --- a/hipamd/lpl_ca/ca.hpp +++ b/hipamd/lpl_ca/ca.hpp @@ -13,92 +13,67 @@ #include #include -namespace hip_impl -{ - inline - clara::Parser cmdline_parser( - bool& help, - std::vector& inputs, - std::string& targets) - { - return - clara::Help{help} | - clara::Arg{inputs, "a" + fat_binary_extension() + " etc."}( - "fat binaries which contain the code objects to be extracted; " - "the binary format of the file(s) is documented at: " - "https://reviews.llvm.org/D13909; " - "the code object format is documented at: " - "https://www.llvm.org/docs/AMDGPUUsage.html#code-object.") | - clara::Opt{targets, "gfx803,gfx900 etc."} - ["-t"]["--targets"]( - "targets for which code objects are to be extracted from " - "the fat binary; must be included in the set of processors " - "with ROCm support from " - "https://www.llvm.org/docs/AMDGPUUsage.html#processors."); - } +namespace hip_impl { +inline clara::Parser cmdline_parser(bool& help, std::vector& inputs, + std::string& targets) { + return clara::Help{help} | + clara::Arg{inputs, "a" + fat_binary_extension() + " etc."}( + "fat binaries which contain the code objects to be extracted; " + "the binary format of the file(s) is documented at: " + "https://reviews.llvm.org/D13909; " + "the code object format is documented at: " + "https://www.llvm.org/docs/AMDGPUUsage.html#code-object.") | + clara::Opt{targets, "gfx803,gfx900 etc."}["-t"]["--targets"]( + "targets for which code objects are to be extracted from " + "the fat binary; must be included in the set of processors " + "with ROCm support from " + "https://www.llvm.org/docs/AMDGPUUsage.html#processors."); +} - inline - std::string make_code_object_file_name( - const std::string& input, const std::string& target) - { - assert(!input.empty() && !target.empty()); +inline std::string make_code_object_file_name(const std::string& input, const std::string& target) { + assert(!input.empty() && !target.empty()); - auto r = input.substr(0, input.find(fat_binary_extension())); - r += '_' + target + code_object_extension(); + auto r = input.substr(0, input.find(fat_binary_extension())); + r += '_' + target + code_object_extension(); - return r; - } + return r; +} - inline - void extract_code_objects( - const std::vector& inputs, - const std::vector& targets) - { - for (auto&& input : inputs) { - std::ifstream tmp{input}; - std::vector bundle{ - std::istreambuf_iterator{tmp}, - std::istreambuf_iterator{}}; +inline void extract_code_objects(const std::vector& inputs, + const std::vector& targets) { + for (auto&& input : inputs) { + std::ifstream tmp{input}; + std::vector bundle{std::istreambuf_iterator{tmp}, + std::istreambuf_iterator{}}; - Bundled_code_header tmp1{bundle}; + Bundled_code_header tmp1{bundle}; - if (!valid(tmp1)) { - throw std::runtime_error{input + " is not a valid fat binary."}; + if (!valid(tmp1)) { + throw std::runtime_error{input + " is not a valid fat binary."}; + } + + for (auto&& target : targets) { + const auto it = std::find_if( + bundles(tmp1).cbegin(), bundles(tmp1).cend(), + [&](const Bundled_code& x) { return x.triple.find(target) != std::string::npos; }); + + if (it == bundles(tmp1).cend()) { + std::cerr << "Warning: " << input << " does not contain code for the " << target + << " target."; + continue; } - for (auto&& target : targets) { - const auto it = std::find_if( - bundles(tmp1).cbegin(), - bundles(tmp1).cend(), - [&](const Bundled_code& x) { - return x.triple.find(target) != std::string::npos; - }); - - if (it == bundles(tmp1).cend()) { - std::cerr << "Warning: " << input - << " does not contain code for the " << target - << " target."; - continue; - } - - std::ofstream out{make_code_object_file_name(input, target)}; - std::copy_n( - it->blob.cbegin(), - it->blob.size(), - std::ostreambuf_iterator{out}); - } + std::ofstream out{make_code_object_file_name(input, target)}; + std::copy_n(it->blob.cbegin(), it->blob.size(), std::ostreambuf_iterator{out}); } } +} - inline - void validate_inputs(const std::vector& inputs) - { - const auto it = std::find_if_not( - inputs.cbegin(), inputs.cend(), file_exists); +inline void validate_inputs(const std::vector& inputs) { + const auto it = std::find_if_not(inputs.cbegin(), inputs.cend(), file_exists); - if (it != inputs.cend()) { - throw std::runtime_error{ - "Non existent file " + *it + " passed as input."}; - } + if (it != inputs.cend()) { + throw std::runtime_error{"Non existent file " + *it + " passed as input."}; } -} \ No newline at end of file +} +} // namespace hip_impl \ No newline at end of file diff --git a/hipamd/lpl_ca/clara/clara.hpp b/hipamd/lpl_ca/clara/clara.hpp index aa429e7a19..10b70da644 100644 --- a/hipamd/lpl_ca/clara/clara.hpp +++ b/hipamd/lpl_ca/clara/clara.hpp @@ -36,312 +36,289 @@ #endif -namespace clara { namespace TextFlow { +namespace clara { +namespace TextFlow { - inline auto isWhitespace( char c ) -> bool { - static std::string chars = " \t\n\r"; - return chars.find( c ) != std::string::npos; - } - inline auto isBreakableBefore( char c ) -> bool { - static std::string chars = "[({<|"; - return chars.find( c ) != std::string::npos; - } - inline auto isBreakableAfter( char c ) -> bool { - static std::string chars = "])}>.,:;*+-=&/\\"; - return chars.find( c ) != std::string::npos; - } +inline auto isWhitespace(char c) -> bool { + static std::string chars = " \t\n\r"; + return chars.find(c) != std::string::npos; +} +inline auto isBreakableBefore(char c) -> bool { + static std::string chars = "[({<|"; + return chars.find(c) != std::string::npos; +} +inline auto isBreakableAfter(char c) -> bool { + static std::string chars = "])}>.,:;*+-=&/\\"; + return chars.find(c) != std::string::npos; +} - class Columns; +class Columns; - class Column { - std::vector m_strings; - size_t m_width = CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH; - size_t m_indent = 0; - size_t m_initialIndent = std::string::npos; +class Column { + std::vector m_strings; + size_t m_width = CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH; + size_t m_indent = 0; + size_t m_initialIndent = std::string::npos; - public: - class iterator { - friend Column; + public: + class iterator { + friend Column; - Column const& m_column; - size_t m_stringIndex = 0; - size_t m_pos = 0; + Column const& m_column; + size_t m_stringIndex = 0; + size_t m_pos = 0; - size_t m_len = 0; - size_t m_end = 0; - bool m_suffix = false; + size_t m_len = 0; + size_t m_end = 0; + bool m_suffix = false; - iterator( Column const& column, size_t stringIndex ) - : m_column( column ), - m_stringIndex( stringIndex ) - {} + iterator(Column const& column, size_t stringIndex) + : m_column(column), m_stringIndex(stringIndex) {} - auto line() const -> std::string const& { return m_column.m_strings[m_stringIndex]; } + auto line() const -> std::string const& { return m_column.m_strings[m_stringIndex]; } - auto isBoundary( size_t at ) const -> bool { - assert( at > 0 ); - assert( at <= line().size() ); + auto isBoundary(size_t at) const -> bool { + assert(at > 0); + assert(at <= line().size()); - return at == line().size() || - ( isWhitespace( line()[at] ) && !isWhitespace( line()[at-1] ) ) || - isBreakableBefore( line()[at] ) || - isBreakableAfter( line()[at-1] ); - } + return at == line().size() || + (isWhitespace(line()[at]) && !isWhitespace(line()[at - 1])) || + isBreakableBefore(line()[at]) || isBreakableAfter(line()[at - 1]); + } - void calcLength() { - assert( m_stringIndex < m_column.m_strings.size() ); + void calcLength() { + assert(m_stringIndex < m_column.m_strings.size()); - m_suffix = false; - auto width = m_column.m_width-indent(); - m_end = m_pos; - while( m_end < line().size() && line()[m_end] != '\n' ) - ++m_end; + m_suffix = false; + auto width = m_column.m_width - indent(); + m_end = m_pos; + while (m_end < line().size() && line()[m_end] != '\n') ++m_end; - if( m_end < m_pos + width ) { - m_len = m_end - m_pos; - } - else { - size_t len = width; - while (len > 0 && !isBoundary(m_pos + len)) - --len; - while (len > 0 && isWhitespace( line()[m_pos + len - 1] )) - --len; + if (m_end < m_pos + width) { + m_len = m_end - m_pos; + } else { + size_t len = width; + while (len > 0 && !isBoundary(m_pos + len)) --len; + while (len > 0 && isWhitespace(line()[m_pos + len - 1])) --len; - if (len > 0) { - m_len = len; - } else { - m_suffix = true; - m_len = width - 1; - } + if (len > 0) { + m_len = len; + } else { + m_suffix = true; + m_len = width - 1; } } + } - auto indent() const -> size_t { - auto initial = m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos; - return initial == std::string::npos ? m_column.m_indent : initial; + auto indent() const -> size_t { + auto initial = + m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos; + return initial == std::string::npos ? m_column.m_indent : initial; + } + + auto addIndentAndSuffix(std::string const& plain) const -> std::string { + return std::string(indent(), ' ') + (m_suffix ? plain + "-" : plain); + } + + public: + explicit iterator(Column const& column) : m_column(column) { + assert(m_column.m_width > m_column.m_indent); + assert(m_column.m_initialIndent == std::string::npos || + m_column.m_width > m_column.m_initialIndent); + calcLength(); + if (m_len == 0) m_stringIndex++; // Empty string + } + + auto operator*() const -> std::string { + assert(m_stringIndex < m_column.m_strings.size()); + assert(m_pos <= m_end); + if (m_pos + m_column.m_width < m_end) + return addIndentAndSuffix(line().substr(m_pos, m_len)); + else + return addIndentAndSuffix(line().substr(m_pos, m_end - m_pos)); + } + + auto operator++() -> iterator& { + m_pos += m_len; + if (m_pos < line().size() && line()[m_pos] == '\n') + m_pos += 1; + else + while (m_pos < line().size() && isWhitespace(line()[m_pos])) ++m_pos; + + if (m_pos == line().size()) { + m_pos = 0; + ++m_stringIndex; } + if (m_stringIndex < m_column.m_strings.size()) calcLength(); + return *this; + } + auto operator++(int) -> iterator { + iterator prev(*this); + operator++(); + return prev; + } - auto addIndentAndSuffix(std::string const &plain) const -> std::string { - return std::string( indent(), ' ' ) + (m_suffix ? plain + "-" : plain); - } + auto operator==(iterator const& other) const -> bool { + return m_pos == other.m_pos && m_stringIndex == other.m_stringIndex && + &m_column == &other.m_column; + } + auto operator!=(iterator const& other) const -> bool { return !operator==(other); } + }; + using const_iterator = iterator; - public: - explicit iterator( Column const& column ) : m_column( column ) { - assert( m_column.m_width > m_column.m_indent ); - assert( m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent ); - calcLength(); - if( m_len == 0 ) - m_stringIndex++; // Empty string - } + explicit Column(std::string const& text) { m_strings.push_back(text); } - auto operator *() const -> std::string { - assert( m_stringIndex < m_column.m_strings.size() ); - assert( m_pos <= m_end ); - if( m_pos + m_column.m_width < m_end ) - return addIndentAndSuffix(line().substr(m_pos, m_len)); - else - return addIndentAndSuffix(line().substr(m_pos, m_end - m_pos)); - } + auto width(size_t newWidth) -> Column& { + assert(newWidth > 0); + m_width = newWidth; + return *this; + } + auto indent(size_t newIndent) -> Column& { + m_indent = newIndent; + return *this; + } + auto initialIndent(size_t newIndent) -> Column& { + m_initialIndent = newIndent; + return *this; + } - auto operator ++() -> iterator& { - m_pos += m_len; - if( m_pos < line().size() && line()[m_pos] == '\n' ) - m_pos += 1; - else - while( m_pos < line().size() && isWhitespace( line()[m_pos] ) ) - ++m_pos; + auto width() const -> size_t { return m_width; } + auto begin() const -> iterator { return iterator(*this); } + auto end() const -> iterator { return {*this, m_strings.size()}; } - if( m_pos == line().size() ) { - m_pos = 0; - ++m_stringIndex; + inline friend std::ostream& operator<<(std::ostream& os, Column const& col) { + bool first = true; + for (auto line : col) { + if (first) + first = false; + else + os << "\n"; + os << line; + } + return os; + } + + auto operator+(Column const& other) -> Columns; + + auto toString() const -> std::string { + std::ostringstream oss; + oss << *this; + return oss.str(); + } +}; + +class Spacer : public Column { + public: + explicit Spacer(size_t spaceWidth) : Column("") { width(spaceWidth); } +}; + +class Columns { + std::vector m_columns; + + public: + class iterator { + friend Columns; + struct EndTag {}; + + std::vector const& m_columns; + std::vector m_iterators; + size_t m_activeIterators; + + iterator(Columns const& columns, EndTag) + : m_columns(columns.m_columns), m_activeIterators(0) { + m_iterators.reserve(m_columns.size()); + + for (auto const& col : m_columns) m_iterators.push_back(col.end()); + } + + public: + explicit iterator(Columns const& columns) + : m_columns(columns.m_columns), m_activeIterators(m_columns.size()) { + m_iterators.reserve(m_columns.size()); + + for (auto const& col : m_columns) m_iterators.push_back(col.begin()); + } + + auto operator==(iterator const& other) const -> bool { + return m_iterators == other.m_iterators; + } + auto operator!=(iterator const& other) const -> bool { + return m_iterators != other.m_iterators; + } + auto operator*() const -> std::string { + std::string row, padding; + + for (size_t i = 0; i < m_columns.size(); ++i) { + auto width = m_columns[i].width(); + if (m_iterators[i] != m_columns[i].end()) { + std::string col = *m_iterators[i]; + row += padding + col; + if (col.size() < width) + padding = std::string(width - col.size(), ' '); + else + padding = ""; + } else { + padding += std::string(width, ' '); } - if( m_stringIndex < m_column.m_strings.size() ) - calcLength(); - return *this; } - auto operator ++(int) -> iterator { - iterator prev( *this ); - operator++(); - return prev; + return row; + } + auto operator++() -> iterator& { + for (size_t i = 0; i < m_columns.size(); ++i) { + if (m_iterators[i] != m_columns[i].end()) ++m_iterators[i]; } - - auto operator ==( iterator const& other ) const -> bool { - return - m_pos == other.m_pos && - m_stringIndex == other.m_stringIndex && - &m_column == &other.m_column; - } - auto operator !=( iterator const& other ) const -> bool { - return !operator==( other ); - } - }; - using const_iterator = iterator; - - explicit Column( std::string const& text ) { m_strings.push_back( text ); } - - auto width( size_t newWidth ) -> Column& { - assert( newWidth > 0 ); - m_width = newWidth; return *this; } - auto indent( size_t newIndent ) -> Column& { - m_indent = newIndent; - return *this; - } - auto initialIndent( size_t newIndent ) -> Column& { - m_initialIndent = newIndent; - return *this; - } - - auto width() const -> size_t { return m_width; } - auto begin() const -> iterator { return iterator( *this ); } - auto end() const -> iterator { return { *this, m_strings.size() }; } - - inline friend std::ostream& operator << ( std::ostream& os, Column const& col ) { - bool first = true; - for( auto line : col ) { - if( first ) - first = false; - else - os << "\n"; - os << line; - } - return os; - } - - auto operator + ( Column const& other ) -> Columns; - - auto toString() const -> std::string { - std::ostringstream oss; - oss << *this; - return oss.str(); + auto operator++(int) -> iterator { + iterator prev(*this); + operator++(); + return prev; } }; + using const_iterator = iterator; - class Spacer : public Column { + auto begin() const -> iterator { return iterator(*this); } + auto end() const -> iterator { return {*this, iterator::EndTag()}; } - public: - explicit Spacer( size_t spaceWidth ) : Column( "" ) { - width( spaceWidth ); - } - }; - - class Columns { - std::vector m_columns; - - public: - - class iterator { - friend Columns; - struct EndTag {}; - - std::vector const& m_columns; - std::vector m_iterators; - size_t m_activeIterators; - - iterator( Columns const& columns, EndTag ) - : m_columns( columns.m_columns ), - m_activeIterators( 0 ) - { - m_iterators.reserve( m_columns.size() ); - - for( auto const& col : m_columns ) - m_iterators.push_back( col.end() ); - } - - public: - explicit iterator( Columns const& columns ) - : m_columns( columns.m_columns ), - m_activeIterators( m_columns.size() ) - { - m_iterators.reserve( m_columns.size() ); - - for( auto const& col : m_columns ) - m_iterators.push_back( col.begin() ); - } - - auto operator ==( iterator const& other ) const -> bool { - return m_iterators == other.m_iterators; - } - auto operator !=( iterator const& other ) const -> bool { - return m_iterators != other.m_iterators; - } - auto operator *() const -> std::string { - std::string row, padding; - - for( size_t i = 0; i < m_columns.size(); ++i ) { - auto width = m_columns[i].width(); - if( m_iterators[i] != m_columns[i].end() ) { - std::string col = *m_iterators[i]; - row += padding + col; - if( col.size() < width ) - padding = std::string( width - col.size(), ' ' ); - else - padding = ""; - } - else { - padding += std::string( width, ' ' ); - } - } - return row; - } - auto operator ++() -> iterator& { - for( size_t i = 0; i < m_columns.size(); ++i ) { - if (m_iterators[i] != m_columns[i].end()) - ++m_iterators[i]; - } - return *this; - } - auto operator ++(int) -> iterator { - iterator prev( *this ); - operator++(); - return prev; - } - }; - using const_iterator = iterator; - - auto begin() const -> iterator { return iterator( *this ); } - auto end() const -> iterator { return { *this, iterator::EndTag() }; } - - auto operator += ( Column const& col ) -> Columns& { - m_columns.push_back( col ); - return *this; - } - auto operator + ( Column const& col ) -> Columns { - Columns combined = *this; - combined += col; - return combined; - } - - inline friend std::ostream& operator << ( std::ostream& os, Columns const& cols ) { - - bool first = true; - for( auto line : cols ) { - if( first ) - first = false; - else - os << "\n"; - os << line; - } - return os; - } - - auto toString() const -> std::string { - std::ostringstream oss; - oss << *this; - return oss.str(); - } - }; - - inline auto Column::operator + ( Column const& other ) -> Columns { - Columns cols; - cols += *this; - cols += other; - return cols; + auto operator+=(Column const& col) -> Columns& { + m_columns.push_back(col); + return *this; + } + auto operator+(Column const& col) -> Columns { + Columns combined = *this; + combined += col; + return combined; } -}} // namespace clara::TextFlow -#endif // CLARA_TEXTFLOW_HPP_INCLUDED + inline friend std::ostream& operator<<(std::ostream& os, Columns const& cols) { + bool first = true; + for (auto line : cols) { + if (first) + first = false; + else + os << "\n"; + os << line; + } + return os; + } + + auto toString() const -> std::string { + std::ostringstream oss; + oss << *this; + return oss.str(); + } +}; + +inline auto Column::operator+(Column const& other) -> Columns { + Columns cols; + cols += *this; + cols += other; + return cols; +} +} // namespace TextFlow +} // namespace clara + +#endif // CLARA_TEXTFLOW_HPP_INCLUDED // ----------- end of #include from clara_textflow.hpp ----------- // ........... back in clara.hpp @@ -351,854 +328,811 @@ namespace clara { namespace TextFlow { #include #include -#if !defined(CLARA_PLATFORM_WINDOWS) && ( defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) ) +#if !defined(CLARA_PLATFORM_WINDOWS) && \ + (defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER)) #define CLARA_PLATFORM_WINDOWS #endif namespace clara { namespace detail { - // Traits for extracting arg and return type of lambdas (for single argument lambdas) - template - struct UnaryLambdaTraits : UnaryLambdaTraits {}; +// Traits for extracting arg and return type of lambdas (for single argument lambdas) +template +struct UnaryLambdaTraits : UnaryLambdaTraits {}; - template - struct UnaryLambdaTraits { - static const bool isValid = false; - }; +template +struct UnaryLambdaTraits { + static const bool isValid = false; +}; - template - struct UnaryLambdaTraits { - static const bool isValid = true; - using ArgType = typename std::remove_const::type>::type;; - using ReturnType = ReturnT; - }; +template +struct UnaryLambdaTraits { + static const bool isValid = true; + using ArgType = typename std::remove_const::type>::type; + ; + using ReturnType = ReturnT; +}; - class TokenStream; +class TokenStream; - // Transport for raw args (copied from main args, or supplied via init list for testing) - class Args { - friend TokenStream; - std::string m_exeName; - std::vector m_args; +// Transport for raw args (copied from main args, or supplied via init list for testing) +class Args { + friend TokenStream; + std::string m_exeName; + std::vector m_args; - public: - Args( int argc, char *argv[] ) { - m_exeName = argv[0]; - for( int i = 1; i < argc; ++i ) - m_args.push_back( argv[i] ); - } + public: + Args(int argc, char* argv[]) { + m_exeName = argv[0]; + for (int i = 1; i < argc; ++i) m_args.push_back(argv[i]); + } - Args( std::initializer_list args ) - : m_exeName( *args.begin() ), - m_args( args.begin()+1, args.end() ) - {} + Args(std::initializer_list args) + : m_exeName(*args.begin()), m_args(args.begin() + 1, args.end()) {} - auto exeName() const -> std::string { - return m_exeName; - } - }; + auto exeName() const -> std::string { return m_exeName; } +}; - // Wraps a token coming from a token stream. These may not directly correspond to strings as a single string - // may encode an option + its argument if the : or = form is used - enum class TokenType { - Option, Argument - }; - struct Token { - TokenType type; - std::string token; - }; +// Wraps a token coming from a token stream. These may not directly correspond to strings as a +// single string may encode an option + its argument if the : or = form is used +enum class TokenType { Option, Argument }; +struct Token { + TokenType type; + std::string token; +}; - inline auto isOptPrefix( char c ) -> bool { - return c == '-' +inline auto isOptPrefix(char c) -> bool { + return c == '-' #ifdef CLARA_PLATFORM_WINDOWS - || c == '/' + || c == '/' #endif ; - } +} - // Abstracts iterators into args as a stream of tokens, with option arguments uniformly handled - class TokenStream { - using Iterator = std::vector::const_iterator; - Iterator it; - Iterator itEnd; - std::vector m_tokenBuffer; +// Abstracts iterators into args as a stream of tokens, with option arguments uniformly handled +class TokenStream { + using Iterator = std::vector::const_iterator; + Iterator it; + Iterator itEnd; + std::vector m_tokenBuffer; - void loadBuffer() { - m_tokenBuffer.resize( 0 ); + void loadBuffer() { + m_tokenBuffer.resize(0); - // Skip any empty strings - while( it != itEnd && it->empty() ) - ++it; + // Skip any empty strings + while (it != itEnd && it->empty()) ++it; - if( it != itEnd ) { - auto const &next = *it; - if( isOptPrefix( next[0] ) ) { - auto delimiterPos = next.find_first_of( " :=" ); - if( delimiterPos != std::string::npos ) { - m_tokenBuffer.push_back( { TokenType::Option, next.substr( 0, delimiterPos ) } ); - m_tokenBuffer.push_back( { TokenType::Argument, next.substr( delimiterPos + 1 ) } ); - } else { - if( next[1] != '-' && next.size() > 2 ) { - std::string opt = "- "; - for( size_t i = 1; i < next.size(); ++i ) { - opt[1] = next[i]; - m_tokenBuffer.push_back( { TokenType::Option, opt } ); - } - } else { - m_tokenBuffer.push_back( { TokenType::Option, next } ); - } - } + if (it != itEnd) { + auto const& next = *it; + if (isOptPrefix(next[0])) { + auto delimiterPos = next.find_first_of(" :="); + if (delimiterPos != std::string::npos) { + m_tokenBuffer.push_back({TokenType::Option, next.substr(0, delimiterPos)}); + m_tokenBuffer.push_back({TokenType::Argument, next.substr(delimiterPos + 1)}); } else { - m_tokenBuffer.push_back( { TokenType::Argument, next } ); + if (next[1] != '-' && next.size() > 2) { + std::string opt = "- "; + for (size_t i = 1; i < next.size(); ++i) { + opt[1] = next[i]; + m_tokenBuffer.push_back({TokenType::Option, opt}); + } + } else { + m_tokenBuffer.push_back({TokenType::Option, next}); + } } + } else { + m_tokenBuffer.push_back({TokenType::Argument, next}); } } + } - public: - explicit TokenStream( Args const &args ) : TokenStream( args.m_args.begin(), args.m_args.end() ) {} + public: + explicit TokenStream(Args const& args) : TokenStream(args.m_args.begin(), args.m_args.end()) {} - TokenStream( Iterator it, Iterator itEnd ) : it( it ), itEnd( itEnd ) { + TokenStream(Iterator it, Iterator itEnd) : it(it), itEnd(itEnd) { loadBuffer(); } + + explicit operator bool() const { return !m_tokenBuffer.empty() || it != itEnd; } + + auto count() const -> size_t { return m_tokenBuffer.size() + (itEnd - it); } + + auto operator*() const -> Token { + assert(!m_tokenBuffer.empty()); + return m_tokenBuffer.front(); + } + + auto operator-> () const -> Token const* { + assert(!m_tokenBuffer.empty()); + return &m_tokenBuffer.front(); + } + + auto operator++() -> TokenStream& { + if (m_tokenBuffer.size() >= 2) { + m_tokenBuffer.erase(m_tokenBuffer.begin()); + } else { + if (it != itEnd) ++it; loadBuffer(); } + return *this; + } +}; - explicit operator bool() const { - return !m_tokenBuffer.empty() || it != itEnd; + +class ResultBase { + public: + enum Type { Ok, LogicError, RuntimeError }; + + protected: + ResultBase(Type type) : m_type(type) {} + virtual ~ResultBase() = default; + + virtual void enforceOk() const = 0; + + Type m_type; +}; + +template +class ResultValueBase : public ResultBase { + public: + auto value() const -> T const& { + enforceOk(); + return m_value; + } + + protected: + ResultValueBase(Type type) : ResultBase(type) {} + + ResultValueBase(ResultValueBase const& other) : ResultBase(other) { + if (m_type == ResultBase::Ok) new (&m_value) T(other.m_value); + } + + ResultValueBase(Type, T const& value) : ResultBase(Ok) { new (&m_value) T(value); } + + auto operator=(ResultValueBase const& other) -> ResultValueBase& { + if (m_type == ResultBase::Ok) m_value.~T(); + ResultBase::operator=(other); + if (m_type == ResultBase::Ok) new (&m_value) T(other.m_value); + return *this; + } + + ~ResultValueBase() { + if (m_type == Ok) m_value.~T(); + } + + union { + T m_value; + }; +}; + +template <> +class ResultValueBase : public ResultBase { + protected: + using ResultBase::ResultBase; +}; + +template +class BasicResult : public ResultValueBase { + public: + template + explicit BasicResult(BasicResult const& other) + : ResultValueBase(other.type()), m_errorMessage(other.errorMessage()) { + assert(type() != ResultBase::Ok); + } + + template + static auto ok(U const& value) -> BasicResult { + return {ResultBase::Ok, value}; + } + static auto ok() -> BasicResult { return {ResultBase::Ok}; } + static auto logicError(std::string const& message) -> BasicResult { + return {ResultBase::LogicError, message}; + } + static auto runtimeError(std::string const& message) -> BasicResult { + return {ResultBase::RuntimeError, message}; + } + + explicit operator bool() const { return m_type == ResultBase::Ok; } + auto type() const -> ResultBase::Type { return m_type; } + auto errorMessage() const -> std::string { return m_errorMessage; } + + protected: + virtual void enforceOk() const { + // !TBD: If no exceptions, std::terminate here or something + switch (m_type) { + case ResultBase::LogicError: + throw std::logic_error(m_errorMessage); + case ResultBase::RuntimeError: + throw std::runtime_error(m_errorMessage); + case ResultBase::Ok: + break; } + } - auto count() const -> size_t { return m_tokenBuffer.size() + (itEnd - it); } + std::string m_errorMessage; // Only populated if resultType is an error - auto operator*() const -> Token { - assert( !m_tokenBuffer.empty() ); - return m_tokenBuffer.front(); - } + BasicResult(ResultBase::Type type, std::string const& message) + : ResultValueBase(type), m_errorMessage(message) { + assert(m_type != ResultBase::Ok); + } - auto operator->() const -> Token const * { - assert( !m_tokenBuffer.empty() ); - return &m_tokenBuffer.front(); - } + using ResultValueBase::ResultValueBase; + using ResultBase::m_type; +}; - auto operator++() -> TokenStream & { - if( m_tokenBuffer.size() >= 2 ) { - m_tokenBuffer.erase( m_tokenBuffer.begin() ); - } else { - if( it != itEnd ) - ++it; - loadBuffer(); - } - return *this; - } +enum class ParseResultType { Matched, NoMatch, ShortCircuitAll, ShortCircuitSame }; + +class ParseState { + public: + ParseState(ParseResultType type, TokenStream const& remainingTokens) + : m_type(type), m_remainingTokens(remainingTokens) {} + + auto type() const -> ParseResultType { return m_type; } + auto remainingTokens() const -> TokenStream { return m_remainingTokens; } + + private: + ParseResultType m_type; + TokenStream m_remainingTokens; +}; + +using Result = BasicResult; +using ParserResult = BasicResult; +using InternalParseResult = BasicResult; + +struct HelpColumns { + std::string left; + std::string right; +}; + +template +inline auto convertInto(std::string const& source, T& target) -> ParserResult { + std::stringstream ss; + ss << source; + ss >> target; + if (ss.fail()) + return ParserResult::runtimeError("Unable to convert '" + source + "' to destination type"); + else + return ParserResult::ok(ParseResultType::Matched); +} +inline auto convertInto(std::string const& source, std::string& target) -> ParserResult { + target = source; + return ParserResult::ok(ParseResultType::Matched); +} +inline auto convertInto(std::string const& source, bool& target) -> ParserResult { + std::string srcLC = source; + std::transform(srcLC.begin(), srcLC.end(), srcLC.begin(), + [](char c) { return static_cast(::tolower(c)); }); + if (srcLC == "y" || srcLC == "1" || srcLC == "true" || srcLC == "yes" || srcLC == "on") + target = true; + else if (srcLC == "n" || srcLC == "0" || srcLC == "false" || srcLC == "no" || srcLC == "off") + target = false; + else + return ParserResult::runtimeError("Expected a boolean value but did not recognise: '" + + source + "'"); + return ParserResult::ok(ParseResultType::Matched); +} + +struct BoundRefBase { + BoundRefBase() = default; + BoundRefBase(BoundRefBase const&) = delete; + BoundRefBase(BoundRefBase&&) = delete; + BoundRefBase& operator=(BoundRefBase const&) = delete; + BoundRefBase& operator=(BoundRefBase&&) = delete; + + virtual ~BoundRefBase() = default; + + virtual auto isFlag() const -> bool = 0; + virtual auto isContainer() const -> bool { return false; } + virtual auto setValue(std::string const& arg) -> ParserResult = 0; + virtual auto setFlag(bool flag) -> ParserResult = 0; +}; + +struct BoundValueRefBase : BoundRefBase { + auto isFlag() const -> bool override { return false; } + + auto setFlag(bool) -> ParserResult override { + return ParserResult::logicError("Flags can only be set on boolean fields"); + } +}; + +struct BoundFlagRefBase : BoundRefBase { + auto isFlag() const -> bool override { return true; } + + auto setValue(std::string const& arg) -> ParserResult override { + bool flag; + auto result = convertInto(arg, flag); + if (result) setFlag(flag); + return result; + } +}; + +template +struct BoundRef : BoundValueRefBase { + T& m_ref; + + explicit BoundRef(T& ref) : m_ref(ref) {} + + auto setValue(std::string const& arg) -> ParserResult override { + return convertInto(arg, m_ref); + } +}; + +template +struct BoundRef> : BoundValueRefBase { + std::vector& m_ref; + + explicit BoundRef(std::vector& ref) : m_ref(ref) {} + + auto isContainer() const -> bool override { return true; } + + auto setValue(std::string const& arg) -> ParserResult override { + T temp; + auto result = convertInto(arg, temp); + if (result) m_ref.push_back(temp); + return result; + } +}; + +struct BoundFlagRef : BoundFlagRefBase { + bool& m_ref; + + explicit BoundFlagRef(bool& ref) : m_ref(ref) {} + + auto setFlag(bool flag) -> ParserResult override { + m_ref = flag; + return ParserResult::ok(ParseResultType::Matched); + } +}; + +template +struct LambdaInvoker { + static_assert(std::is_same::value, + "Lambda must return void or clara::ParserResult"); + + template + static auto invoke(L const& lambda, ArgType const& arg) -> ParserResult { + return lambda(arg); + } +}; + +template <> +struct LambdaInvoker { + template + static auto invoke(L const& lambda, ArgType const& arg) -> ParserResult { + lambda(arg); + return ParserResult::ok(ParseResultType::Matched); + } +}; + +template +inline auto invokeLambda(L const& lambda, std::string const& arg) -> ParserResult { + ArgType temp; + auto result = convertInto(arg, temp); + return !result ? result + : LambdaInvoker::ReturnType>::invoke(lambda, temp); +}; + + +template +struct BoundLambda : BoundValueRefBase { + L m_lambda; + + static_assert(UnaryLambdaTraits::isValid, "Supplied lambda must take exactly one argument"); + explicit BoundLambda(L const& lambda) : m_lambda(lambda) {} + + auto setValue(std::string const& arg) -> ParserResult override { + return invokeLambda::ArgType>(m_lambda, arg); + } +}; + +template +struct BoundFlagLambda : BoundFlagRefBase { + L m_lambda; + + static_assert(UnaryLambdaTraits::isValid, "Supplied lambda must take exactly one argument"); + static_assert(std::is_same::ArgType, bool>::value, + "flags must be boolean"); + + explicit BoundFlagLambda(L const& lambda) : m_lambda(lambda) {} + + auto setFlag(bool flag) -> ParserResult override { + return LambdaInvoker::ReturnType>::invoke(m_lambda, flag); + } +}; + +enum class Optionality { Optional, Required }; + +struct Parser; + +class ParserBase { + public: + virtual ~ParserBase() = default; + virtual auto validate() const -> Result { return Result::ok(); } + virtual auto parse(std::string const& exeName, TokenStream const& tokens) const + -> InternalParseResult = 0; + virtual auto cardinality() const -> size_t { return 1; } + + auto parse(Args const& args) const -> InternalParseResult { + return parse(args.exeName(), TokenStream(args)); + } +}; + +template +class ComposableParserImpl : public ParserBase { + public: + template + auto operator|(T const& other) const -> Parser; +}; + +// Common code and state for Args and Opts +template +class ParserRefImpl : public ComposableParserImpl { + protected: + Optionality m_optionality = Optionality::Optional; + std::shared_ptr m_ref; + std::string m_hint; + std::string m_description; + + explicit ParserRefImpl(std::shared_ptr const& ref) : m_ref(ref) {} + + public: + template + ParserRefImpl(T& ref, std::string const& hint) + : m_ref(std::make_shared>(ref)), m_hint(hint) {} + + template + ParserRefImpl(LambdaT const& ref, std::string const& hint) + : m_ref(std::make_shared>(ref)), m_hint(hint) {} + + auto operator()(std::string const& description) -> DerivedT& { + m_description = description; + return static_cast(*this); + } + + auto optional() -> DerivedT& { + m_optionality = Optionality::Optional; + return static_cast(*this); }; - - class ResultBase { - public: - enum Type { - Ok, LogicError, RuntimeError - }; - - protected: - ResultBase( Type type ) : m_type( type ) {} - virtual ~ResultBase() = default; - - virtual void enforceOk() const = 0; - - Type m_type; + auto required() -> DerivedT& { + m_optionality = Optionality::Required; + return static_cast(*this); }; - template - class ResultValueBase : public ResultBase { - public: - auto value() const -> T const & { - enforceOk(); - return m_value; - } + auto isOptional() const -> bool { return m_optionality == Optionality::Optional; } - protected: - ResultValueBase( Type type ) : ResultBase( type ) {} - - ResultValueBase( ResultValueBase const &other ) : ResultBase( other ) { - if( m_type == ResultBase::Ok ) - new( &m_value ) T( other.m_value ); - } - - ResultValueBase( Type, T const &value ) : ResultBase( Ok ) { - new( &m_value ) T( value ); - } - - auto operator=( ResultValueBase const &other ) -> ResultValueBase & { - if( m_type == ResultBase::Ok ) - m_value.~T(); - ResultBase::operator=(other); - if( m_type == ResultBase::Ok ) - new( &m_value ) T( other.m_value ); - return *this; - } - - ~ResultValueBase() { - if( m_type == Ok ) - m_value.~T(); - } - - union { - T m_value; - }; - }; - - template<> - class ResultValueBase : public ResultBase { - protected: - using ResultBase::ResultBase; - }; - - template - class BasicResult : public ResultValueBase { - public: - template - explicit BasicResult( BasicResult const &other ) - : ResultValueBase( other.type() ), - m_errorMessage( other.errorMessage() ) - { - assert( type() != ResultBase::Ok ); - } - - template - static auto ok( U const &value ) -> BasicResult { return { ResultBase::Ok, value }; } - static auto ok() -> BasicResult { return { ResultBase::Ok }; } - static auto logicError( std::string const &message ) -> BasicResult { return { ResultBase::LogicError, message }; } - static auto runtimeError( std::string const &message ) -> BasicResult { return { ResultBase::RuntimeError, message }; } - - explicit operator bool() const { return m_type == ResultBase::Ok; } - auto type() const -> ResultBase::Type { return m_type; } - auto errorMessage() const -> std::string { return m_errorMessage; } - - protected: - virtual void enforceOk() const { - // !TBD: If no exceptions, std::terminate here or something - switch( m_type ) { - case ResultBase::LogicError: - throw std::logic_error( m_errorMessage ); - case ResultBase::RuntimeError: - throw std::runtime_error( m_errorMessage ); - case ResultBase::Ok: - break; - } - } - - std::string m_errorMessage; // Only populated if resultType is an error - - BasicResult( ResultBase::Type type, std::string const &message ) - : ResultValueBase(type), - m_errorMessage(message) - { - assert( m_type != ResultBase::Ok ); - } - - using ResultValueBase::ResultValueBase; - using ResultBase::m_type; - }; - - enum class ParseResultType { - Matched, NoMatch, ShortCircuitAll, ShortCircuitSame - }; - - class ParseState { - public: - - ParseState( ParseResultType type, TokenStream const &remainingTokens ) - : m_type(type), - m_remainingTokens( remainingTokens ) - {} - - auto type() const -> ParseResultType { return m_type; } - auto remainingTokens() const -> TokenStream { return m_remainingTokens; } - - private: - ParseResultType m_type; - TokenStream m_remainingTokens; - }; - - using Result = BasicResult; - using ParserResult = BasicResult; - using InternalParseResult = BasicResult; - - struct HelpColumns { - std::string left; - std::string right; - }; - - template - inline auto convertInto( std::string const &source, T& target ) -> ParserResult { - std::stringstream ss; - ss << source; - ss >> target; - if( ss.fail() ) - return ParserResult::runtimeError( "Unable to convert '" + source + "' to destination type" ); + auto cardinality() const -> size_t override { + if (m_ref->isContainer()) + return 0; else - return ParserResult::ok( ParseResultType::Matched ); + return 1; } - inline auto convertInto( std::string const &source, std::string& target ) -> ParserResult { - target = source; - return ParserResult::ok( ParseResultType::Matched ); + + auto hint() const -> std::string { return m_hint; } +}; + +class ExeName : public ComposableParserImpl { + std::shared_ptr m_name; + std::shared_ptr m_ref; + + template + static auto makeRef(LambdaT const& lambda) -> std::shared_ptr { + return std::make_shared>(lambda); } - inline auto convertInto( std::string const &source, bool &target ) -> ParserResult { - std::string srcLC = source; - std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( char c ) { return static_cast( ::tolower(c) ); } ); - if (srcLC == "y" || srcLC == "1" || srcLC == "true" || srcLC == "yes" || srcLC == "on") - target = true; - else if (srcLC == "n" || srcLC == "0" || srcLC == "false" || srcLC == "no" || srcLC == "off") - target = false; + + public: + ExeName() : m_name(std::make_shared("")) {} + + explicit ExeName(std::string& ref) : ExeName() { + m_ref = std::make_shared>(ref); + } + + template + explicit ExeName(LambdaT const& lambda) : ExeName() { + m_ref = std::make_shared>(lambda); + } + + // The exe name is not parsed out of the normal tokens, but is handled specially + auto parse(std::string const&, TokenStream const& tokens) const + -> InternalParseResult override { + return InternalParseResult::ok(ParseState(ParseResultType::NoMatch, tokens)); + } + + auto name() const -> std::string { return *m_name; } + auto set(std::string const& newName) -> ParserResult { + auto lastSlash = newName.find_last_of("\\/"); + auto filename = (lastSlash == std::string::npos) ? newName : newName.substr(lastSlash + 1); + + *m_name = filename; + if (m_ref) + return m_ref->setValue(filename); else - return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + source + "'" ); - return ParserResult::ok( ParseResultType::Matched ); + return ParserResult::ok(ParseResultType::Matched); } +}; - struct BoundRefBase { - BoundRefBase() = default; - BoundRefBase( BoundRefBase const & ) = delete; - BoundRefBase( BoundRefBase && ) = delete; - BoundRefBase &operator=( BoundRefBase const & ) = delete; - BoundRefBase &operator=( BoundRefBase && ) = delete; +class Arg : public ParserRefImpl { + public: + using ParserRefImpl::ParserRefImpl; - virtual ~BoundRefBase() = default; + auto parse(std::string const&, TokenStream const& tokens) const + -> InternalParseResult override { + auto validationResult = validate(); + if (!validationResult) return InternalParseResult(validationResult); - virtual auto isFlag() const -> bool = 0; - virtual auto isContainer() const -> bool { return false; } - virtual auto setValue( std::string const &arg ) -> ParserResult = 0; - virtual auto setFlag( bool flag ) -> ParserResult = 0; - }; + auto remainingTokens = tokens; + auto const& token = *remainingTokens; + if (token.type != TokenType::Argument) + return InternalParseResult::ok(ParseState(ParseResultType::NoMatch, remainingTokens)); - struct BoundValueRefBase : BoundRefBase { - auto isFlag() const -> bool override { return false; } + auto result = m_ref->setValue(remainingTokens->token); + if (!result) + return InternalParseResult(result); + else + return InternalParseResult::ok(ParseState(ParseResultType::Matched, ++remainingTokens)); + } +}; - auto setFlag( bool ) -> ParserResult override { - return ParserResult::logicError( "Flags can only be set on boolean fields" ); - } - }; - - struct BoundFlagRefBase : BoundRefBase { - auto isFlag() const -> bool override { return true; } - - auto setValue( std::string const &arg ) -> ParserResult override { - bool flag; - auto result = convertInto( arg, flag ); - if( result ) - setFlag( flag ); - return result; - } - }; - - template - struct BoundRef : BoundValueRefBase { - T &m_ref; - - explicit BoundRef( T &ref ) : m_ref( ref ) {} - - auto setValue( std::string const &arg ) -> ParserResult override { - return convertInto( arg, m_ref ); - } - }; - - template - struct BoundRef> : BoundValueRefBase { - std::vector &m_ref; - - explicit BoundRef( std::vector &ref ) : m_ref( ref ) {} - - auto isContainer() const -> bool override { return true; } - - auto setValue( std::string const &arg ) -> ParserResult override { - T temp; - auto result = convertInto( arg, temp ); - if( result ) - m_ref.push_back( temp ); - return result; - } - }; - - struct BoundFlagRef : BoundFlagRefBase { - bool &m_ref; - - explicit BoundFlagRef( bool &ref ) : m_ref( ref ) {} - - auto setFlag( bool flag ) -> ParserResult override { - m_ref = flag; - return ParserResult::ok( ParseResultType::Matched ); - } - }; - - template - struct LambdaInvoker { - static_assert( std::is_same::value, "Lambda must return void or clara::ParserResult" ); - - template - static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult { - return lambda( arg ); - } - }; - - template<> - struct LambdaInvoker { - template - static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult { - lambda( arg ); - return ParserResult::ok( ParseResultType::Matched ); - } - }; - - template - inline auto invokeLambda( L const &lambda, std::string const &arg ) -> ParserResult { - ArgType temp; - auto result = convertInto( arg, temp ); - return !result - ? result - : LambdaInvoker::ReturnType>::invoke( lambda, temp ); - }; - - - template - struct BoundLambda : BoundValueRefBase { - L m_lambda; - - static_assert( UnaryLambdaTraits::isValid, "Supplied lambda must take exactly one argument" ); - explicit BoundLambda( L const &lambda ) : m_lambda( lambda ) {} - - auto setValue( std::string const &arg ) -> ParserResult override { - return invokeLambda::ArgType>( m_lambda, arg ); - } - }; - - template - struct BoundFlagLambda : BoundFlagRefBase { - L m_lambda; - - static_assert( UnaryLambdaTraits::isValid, "Supplied lambda must take exactly one argument" ); - static_assert( std::is_same::ArgType, bool>::value, "flags must be boolean" ); - - explicit BoundFlagLambda( L const &lambda ) : m_lambda( lambda ) {} - - auto setFlag( bool flag ) -> ParserResult override { - return LambdaInvoker::ReturnType>::invoke( m_lambda, flag ); - } - }; - - enum class Optionality { Optional, Required }; - - struct Parser; - - class ParserBase { - public: - virtual ~ParserBase() = default; - virtual auto validate() const -> Result { return Result::ok(); } - virtual auto parse( std::string const& exeName, TokenStream const &tokens) const -> InternalParseResult = 0; - virtual auto cardinality() const -> size_t { return 1; } - - auto parse( Args const &args ) const -> InternalParseResult { - return parse( args.exeName(), TokenStream( args ) ); - } - }; - - template - class ComposableParserImpl : public ParserBase { - public: - template - auto operator|( T const &other ) const -> Parser; - }; - - // Common code and state for Args and Opts - template - class ParserRefImpl : public ComposableParserImpl { - protected: - Optionality m_optionality = Optionality::Optional; - std::shared_ptr m_ref; - std::string m_hint; - std::string m_description; - - explicit ParserRefImpl( std::shared_ptr const &ref ) : m_ref( ref ) {} - - public: - template - ParserRefImpl( T &ref, std::string const &hint ) - : m_ref( std::make_shared>( ref ) ), - m_hint( hint ) - {} - - template - ParserRefImpl( LambdaT const &ref, std::string const &hint ) - : m_ref( std::make_shared>( ref ) ), - m_hint(hint) - {} - - auto operator()( std::string const &description ) -> DerivedT & { - m_description = description; - return static_cast( *this ); - } - - auto optional() -> DerivedT & { - m_optionality = Optionality::Optional; - return static_cast( *this ); - }; - - auto required() -> DerivedT & { - m_optionality = Optionality::Required; - return static_cast( *this ); - }; - - auto isOptional() const -> bool { - return m_optionality == Optionality::Optional; - } - - auto cardinality() const -> size_t override { - if( m_ref->isContainer() ) - return 0; - else - return 1; - } - - auto hint() const -> std::string { return m_hint; } - }; - - class ExeName : public ComposableParserImpl { - std::shared_ptr m_name; - std::shared_ptr m_ref; - - template - static auto makeRef(LambdaT const &lambda) -> std::shared_ptr { - return std::make_shared>( lambda) ; - } - - public: - ExeName() : m_name( std::make_shared( "" ) ) {} - - explicit ExeName( std::string &ref ) : ExeName() { - m_ref = std::make_shared>( ref ); - } - - template - explicit ExeName( LambdaT const& lambda ) : ExeName() { - m_ref = std::make_shared>( lambda ); - } - - // The exe name is not parsed out of the normal tokens, but is handled specially - auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override { - return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, tokens ) ); - } - - auto name() const -> std::string { return *m_name; } - auto set( std::string const& newName ) -> ParserResult { - - auto lastSlash = newName.find_last_of( "\\/" ); - auto filename = ( lastSlash == std::string::npos ) - ? newName - : newName.substr( lastSlash+1 ); - - *m_name = filename; - if( m_ref ) - return m_ref->setValue( filename ); - else - return ParserResult::ok( ParseResultType::Matched ); - } - }; - - class Arg : public ParserRefImpl { - public: - using ParserRefImpl::ParserRefImpl; - - auto parse( std::string const &, TokenStream const &tokens ) const -> InternalParseResult override { - auto validationResult = validate(); - if( !validationResult ) - return InternalParseResult( validationResult ); - - auto remainingTokens = tokens; - auto const &token = *remainingTokens; - if( token.type != TokenType::Argument ) - return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) ); - - auto result = m_ref->setValue( remainingTokens->token ); - if( !result ) - return InternalParseResult( result ); - else - return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) ); - } - }; - - inline auto normaliseOpt( std::string const &optName ) -> std::string { +inline auto normaliseOpt(std::string const& optName) -> std::string { #ifdef CLARA_PLATFORM_WINDOWS - if( optName[0] == '/' ) - return "-" + optName.substr( 1 ); - else + if (optName[0] == '/') + return "-" + optName.substr(1); + else #endif - return optName; + return optName; +} + +class Opt : public ParserRefImpl { + protected: + std::vector m_optNames; + + public: + template + explicit Opt(LambdaT const& ref) + : ParserRefImpl(std::make_shared>(ref)) {} + + explicit Opt(bool& ref) : ParserRefImpl(std::make_shared(ref)) {} + + template + Opt(LambdaT const& ref, std::string const& hint) : ParserRefImpl(ref, hint) {} + + template + Opt(T& ref, std::string const& hint) : ParserRefImpl(ref, hint) {} + + auto operator[](std::string const& optName) -> Opt& { + m_optNames.push_back(optName); + return *this; } - class Opt : public ParserRefImpl { - protected: - std::vector m_optNames; - - public: - template - explicit Opt( LambdaT const &ref ) : ParserRefImpl( std::make_shared>( ref ) ) {} - - explicit Opt( bool &ref ) : ParserRefImpl( std::make_shared( ref ) ) {} - - template - Opt( LambdaT const &ref, std::string const &hint ) : ParserRefImpl( ref, hint ) {} - - template - Opt( T &ref, std::string const &hint ) : ParserRefImpl( ref, hint ) {} - - auto operator[]( std::string const &optName ) -> Opt & { - m_optNames.push_back( optName ); - return *this; + auto getHelpColumns() const -> std::vector { + std::ostringstream oss; + bool first = true; + for (auto const& opt : m_optNames) { + if (first) + first = false; + else + oss << ", "; + oss << opt; } + if (!m_hint.empty()) oss << " <" << m_hint << ">"; + return {{oss.str(), m_description}}; + } - auto getHelpColumns() const -> std::vector { - std::ostringstream oss; - bool first = true; - for( auto const &opt : m_optNames ) { + auto isMatch(std::string const& optToken) const -> bool { + auto normalisedToken = normaliseOpt(optToken); + for (auto const& name : m_optNames) { + if (normaliseOpt(name) == normalisedToken) return true; + } + return false; + } + + using ParserBase::parse; + + auto parse(std::string const&, TokenStream const& tokens) const + -> InternalParseResult override { + auto validationResult = validate(); + if (!validationResult) return InternalParseResult(validationResult); + + auto remainingTokens = tokens; + if (remainingTokens && remainingTokens->type == TokenType::Option) { + auto const& token = *remainingTokens; + if (isMatch(token.token)) { + if (m_ref->isFlag()) { + auto result = m_ref->setFlag(true); + if (!result) return InternalParseResult(result); + if (result.value() == ParseResultType::ShortCircuitAll) + return InternalParseResult::ok(ParseState(result.value(), remainingTokens)); + } else { + ++remainingTokens; + if (!remainingTokens) + return InternalParseResult::runtimeError("Expected argument following " + + token.token); + auto const& argToken = *remainingTokens; + if (argToken.type != TokenType::Argument) + return InternalParseResult::runtimeError("Expected argument following " + + token.token); + auto result = m_ref->setValue(argToken.token); + if (!result) return InternalParseResult(result); + if (result.value() == ParseResultType::ShortCircuitAll) + return InternalParseResult::ok(ParseState(result.value(), remainingTokens)); + } + return InternalParseResult::ok( + ParseState(ParseResultType::Matched, ++remainingTokens)); + } + } + return InternalParseResult::ok(ParseState(ParseResultType::NoMatch, remainingTokens)); + } + + auto validate() const -> Result override { + if (m_optNames.empty()) return Result::logicError("No options supplied to Opt"); + for (auto const& name : m_optNames) { + if (name.empty()) return Result::logicError("Option name cannot be empty"); +#ifdef CLARA_PLATFORM_WINDOWS + if (name[0] != '-' && name[0] != '/') + return Result::logicError("Option name must begin with '-' or '/'"); +#else + if (name[0] != '-') return Result::logicError("Option name must begin with '-'"); +#endif + } + return ParserRefImpl::validate(); + } +}; + +struct Help : Opt { + Help(bool& showHelpFlag) + : Opt([&](bool flag) { + showHelpFlag = flag; + return ParserResult::ok(ParseResultType::ShortCircuitAll); + }) { + static_cast (*this)("display usage information")["-?"]["-h"]["--help"].optional(); + } +}; + + +struct Parser : ParserBase { + mutable ExeName m_exeName; + std::vector m_options; + std::vector m_args; + + auto operator|=(ExeName const& exeName) -> Parser& { + m_exeName = exeName; + return *this; + } + + auto operator|=(Arg const& arg) -> Parser& { + m_args.push_back(arg); + return *this; + } + + auto operator|=(Opt const& opt) -> Parser& { + m_options.push_back(opt); + return *this; + } + + auto operator|=(Parser const& other) -> Parser& { + m_options.insert(m_options.end(), other.m_options.begin(), other.m_options.end()); + m_args.insert(m_args.end(), other.m_args.begin(), other.m_args.end()); + return *this; + } + + template + auto operator|(T const& other) const -> Parser { + return Parser(*this) |= other; + } + + auto getHelpColumns() const -> std::vector { + std::vector cols; + for (auto const& o : m_options) { + auto childCols = o.getHelpColumns(); + cols.insert(cols.end(), childCols.begin(), childCols.end()); + } + return cols; + } + + void writeToStream(std::ostream& os) const { + if (!m_exeName.name().empty()) { + os << "usage:\n" + << " " << m_exeName.name() << " "; + bool required = true, first = true; + for (auto const& arg : m_args) { if (first) first = false; else - oss << ", "; - oss << opt; - } - if( !m_hint.empty() ) - oss << " <" << m_hint << ">"; - return { { oss.str(), m_description } }; - } - - auto isMatch( std::string const &optToken ) const -> bool { - auto normalisedToken = normaliseOpt( optToken ); - for( auto const &name : m_optNames ) { - if( normaliseOpt( name ) == normalisedToken ) - return true; - } - return false; - } - - using ParserBase::parse; - - auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override { - auto validationResult = validate(); - if( !validationResult ) - return InternalParseResult( validationResult ); - - auto remainingTokens = tokens; - if( remainingTokens && remainingTokens->type == TokenType::Option ) { - auto const &token = *remainingTokens; - if( isMatch(token.token ) ) { - if( m_ref->isFlag() ) { - auto result = m_ref->setFlag( true ); - if( !result ) - return InternalParseResult( result ); - if( result.value() == ParseResultType::ShortCircuitAll ) - return InternalParseResult::ok( ParseState( result.value(), remainingTokens ) ); - } else { - ++remainingTokens; - if( !remainingTokens ) - return InternalParseResult::runtimeError( "Expected argument following " + token.token ); - auto const &argToken = *remainingTokens; - if( argToken.type != TokenType::Argument ) - return InternalParseResult::runtimeError( "Expected argument following " + token.token ); - auto result = m_ref->setValue( argToken.token ); - if( !result ) - return InternalParseResult( result ); - if( result.value() == ParseResultType::ShortCircuitAll ) - return InternalParseResult::ok( ParseState( result.value(), remainingTokens ) ); - } - return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) ); + os << " "; + if (arg.isOptional() && required) { + os << "["; + required = false; } + os << "<" << arg.hint() << ">"; + if (arg.cardinality() == 0) os << " ... "; } - return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) ); + if (!required) os << "]"; + if (!m_options.empty()) os << " options"; + os << "\n\nwhere options are:" << std::endl; } - auto validate() const -> Result override { - if( m_optNames.empty() ) - return Result::logicError( "No options supplied to Opt" ); - for( auto const &name : m_optNames ) { - if( name.empty() ) - return Result::logicError( "Option name cannot be empty" ); -#ifdef CLARA_PLATFORM_WINDOWS - if( name[0] != '-' && name[0] != '/' ) - return Result::logicError( "Option name must begin with '-' or '/'" ); -#else - if( name[0] != '-' ) - return Result::logicError( "Option name must begin with '-'" ); -#endif - } - return ParserRefImpl::validate(); + auto rows = getHelpColumns(); + size_t consoleWidth = CLARA_CONFIG_CONSOLE_WIDTH; + size_t optWidth = 0; + for (auto const& cols : rows) optWidth = (std::max)(optWidth, cols.left.size() + 2); + + for (auto const& cols : rows) { + auto row = TextFlow::Column(cols.left).width(optWidth).indent(2) + TextFlow::Spacer(4) + + TextFlow::Column(cols.right).width(consoleWidth - 7 - optWidth); + os << row << std::endl; } - }; - - struct Help : Opt { - Help( bool &showHelpFlag ) - : Opt([&]( bool flag ) { - showHelpFlag = flag; - return ParserResult::ok( ParseResultType::ShortCircuitAll ); - }) - { - static_cast( *this ) - ("display usage information") - ["-?"]["-h"]["--help"] - .optional(); - } - }; - - - struct Parser : ParserBase { - - mutable ExeName m_exeName; - std::vector m_options; - std::vector m_args; - - auto operator|=( ExeName const &exeName ) -> Parser & { - m_exeName = exeName; - return *this; - } - - auto operator|=( Arg const &arg ) -> Parser & { - m_args.push_back(arg); - return *this; - } - - auto operator|=( Opt const &opt ) -> Parser & { - m_options.push_back(opt); - return *this; - } - - auto operator|=( Parser const &other ) -> Parser & { - m_options.insert(m_options.end(), other.m_options.begin(), other.m_options.end()); - m_args.insert(m_args.end(), other.m_args.begin(), other.m_args.end()); - return *this; - } - - template - auto operator|( T const &other ) const -> Parser { - return Parser( *this ) |= other; - } - - auto getHelpColumns() const -> std::vector { - std::vector cols; - for (auto const &o : m_options) { - auto childCols = o.getHelpColumns(); - cols.insert( cols.end(), childCols.begin(), childCols.end() ); - } - return cols; - } - - void writeToStream( std::ostream &os ) const { - if (!m_exeName.name().empty()) { - os << "usage:\n" << " " << m_exeName.name() << " "; - bool required = true, first = true; - for( auto const &arg : m_args ) { - if (first) - first = false; - else - os << " "; - if( arg.isOptional() && required ) { - os << "["; - required = false; - } - os << "<" << arg.hint() << ">"; - if( arg.cardinality() == 0 ) - os << " ... "; - } - if( !required ) - os << "]"; - if( !m_options.empty() ) - os << " options"; - os << "\n\nwhere options are:" << std::endl; - } - - auto rows = getHelpColumns(); - size_t consoleWidth = CLARA_CONFIG_CONSOLE_WIDTH; - size_t optWidth = 0; - for( auto const &cols : rows ) - optWidth = (std::max)(optWidth, cols.left.size() + 2); - - for( auto const &cols : rows ) { - auto row = - TextFlow::Column( cols.left ).width( optWidth ).indent( 2 ) + - TextFlow::Spacer(4) + - TextFlow::Column( cols.right ).width( consoleWidth - 7 - optWidth ); - os << row << std::endl; - } - } - - friend auto operator<<( std::ostream &os, Parser const &parser ) -> std::ostream& { - parser.writeToStream( os ); - return os; - } - - auto validate() const -> Result override { - for( auto const &opt : m_options ) { - auto result = opt.validate(); - if( !result ) - return result; - } - for( auto const &arg : m_args ) { - auto result = arg.validate(); - if( !result ) - return result; - } - return Result::ok(); - } - - using ParserBase::parse; - - auto parse( std::string const& exeName, TokenStream const &tokens ) const -> InternalParseResult override { - - struct ParserInfo { - ParserBase const* parser = nullptr; - size_t count = 0; - }; - const size_t totalParsers = m_options.size() + m_args.size(); - assert( totalParsers < 512 ); - // ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do - ParserInfo parseInfos[512]; - - { - size_t i = 0; - for (auto const &opt : m_options) parseInfos[i++].parser = &opt; - for (auto const &arg : m_args) parseInfos[i++].parser = &arg; - } - - m_exeName.set( exeName ); - - auto result = InternalParseResult::ok( ParseState( ParseResultType::NoMatch, tokens ) ); - while( result.value().remainingTokens() ) { - bool tokenParsed = false; - - for( size_t i = 0; i < totalParsers; ++i ) { - auto& parseInfo = parseInfos[i]; - if( parseInfo.parser->cardinality() == 0 || parseInfo.count < parseInfo.parser->cardinality() ) { - result = parseInfo.parser->parse(exeName, result.value().remainingTokens()); - if (!result) - return result; - if (result.value().type() != ParseResultType::NoMatch) { - tokenParsed = true; - ++parseInfo.count; - break; - } - } - } - - if( result.value().type() == ParseResultType::ShortCircuitAll ) - return result; - if( !tokenParsed ) - return InternalParseResult::runtimeError( "Unrecognised token: " + result.value().remainingTokens()->token ); - } - // !TBD Check missing required options - return result; - } - }; - - template - template - auto ComposableParserImpl::operator|( T const &other ) const -> Parser { - return Parser() | static_cast( *this ) | other; } -} // namespace detail + + friend auto operator<<(std::ostream& os, Parser const& parser) -> std::ostream& { + parser.writeToStream(os); + return os; + } + + auto validate() const -> Result override { + for (auto const& opt : m_options) { + auto result = opt.validate(); + if (!result) return result; + } + for (auto const& arg : m_args) { + auto result = arg.validate(); + if (!result) return result; + } + return Result::ok(); + } + + using ParserBase::parse; + + auto parse(std::string const& exeName, TokenStream const& tokens) const + -> InternalParseResult override { + struct ParserInfo { + ParserBase const* parser = nullptr; + size_t count = 0; + }; + const size_t totalParsers = m_options.size() + m_args.size(); + assert(totalParsers < 512); + // ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do + ParserInfo parseInfos[512]; + + { + size_t i = 0; + for (auto const& opt : m_options) parseInfos[i++].parser = &opt; + for (auto const& arg : m_args) parseInfos[i++].parser = &arg; + } + + m_exeName.set(exeName); + + auto result = InternalParseResult::ok(ParseState(ParseResultType::NoMatch, tokens)); + while (result.value().remainingTokens()) { + bool tokenParsed = false; + + for (size_t i = 0; i < totalParsers; ++i) { + auto& parseInfo = parseInfos[i]; + if (parseInfo.parser->cardinality() == 0 || + parseInfo.count < parseInfo.parser->cardinality()) { + result = parseInfo.parser->parse(exeName, result.value().remainingTokens()); + if (!result) return result; + if (result.value().type() != ParseResultType::NoMatch) { + tokenParsed = true; + ++parseInfo.count; + break; + } + } + } + + if (result.value().type() == ParseResultType::ShortCircuitAll) return result; + if (!tokenParsed) + return InternalParseResult::runtimeError("Unrecognised token: " + + result.value().remainingTokens()->token); + } + // !TBD Check missing required options + return result; + } +}; + +template +template +auto ComposableParserImpl::operator|(T const& other) const -> Parser { + return Parser() | static_cast(*this) | other; +} +} // namespace detail // A Combined parser @@ -1226,6 +1160,6 @@ using detail::ParseResultType; using detail::ParserResult; -} // namespace clara +} // namespace clara -#endif // CLARA_HPP_INCLUDED +#endif // CLARA_HPP_INCLUDED diff --git a/hipamd/lpl_ca/common.hpp b/hipamd/lpl_ca/common.hpp index a82c1c5a54..74f4db9221 100644 --- a/hipamd/lpl_ca/common.hpp +++ b/hipamd/lpl_ca/common.hpp @@ -8,86 +8,73 @@ #include #include -namespace hip_impl -{ - inline - const std::unordered_set& amdgpu_targets() - { // The evolving list lives at: - // https://www.llvm.org/docs/AMDGPUUsage.html#processors. - static const std::unordered_set r{ - "gfx701", "gfx801", "gfx802", "gfx803", "gfx900"}; +namespace hip_impl { +inline const std::unordered_set& amdgpu_targets() { // The evolving list lives at: + // https://www.llvm.org/docs/AMDGPUUsage.html#processors. + static const std::unordered_set r{"gfx701", "gfx801", "gfx802", "gfx803", + "gfx900"}; - return r; + return r; +} + +inline const std::string& code_object_extension() { + static const std::string r{".ffa"}; + + return r; +} + +inline const std::string& fat_binary_extension() { + static const std::string r{".adipose"}; + + return r; +} + +inline bool file_exists(const std::string& path_to) { + return static_cast(std::ifstream{path_to}); +} + +inline std::vector tokenize_targets( + const std::string& + x) { // TODO: move to regular expressions once we clarify the need to support + // ancient standard library implementations. + if (x.empty()) return {}; + + static constexpr const char valid_characters[] = "gfx0123456789,"; + + if (x.find_first_not_of(valid_characters) != std::string::npos) { + throw std::runtime_error{"Invalid target string: " + x}; } - inline - const std::string& code_object_extension() - { - static const std::string r{".ffa"}; + std::vector r; - return r; - } + auto it = x.cbegin(); + do { + auto it1 = std::find(it, x.cend(), ','); + r.emplace_back(it, it1); - inline - const std::string& fat_binary_extension() - { - static const std::string r{".adipose"}; + if (it1 == x.cend()) break; - return r; - } + it = ++it1; + } while (true); - inline - bool file_exists(const std::string& path_to) - { - return static_cast(std::ifstream{path_to}); - } + return r; +} - inline - std::vector tokenize_targets(const std::string& x) - { // TODO: move to regular expressions once we clarify the need to support - // ancient standard library implementations. - if (x.empty()) return {}; +inline void validate_targets(const std::vector& x) { + assert(!x.empty()); - static constexpr const char valid_characters[] = "gfx0123456789,"; + for (auto&& t : x) { + static const std::string digits{"0123456789"}; + static const std::string pre{"gfx"}; - if (x.find_first_not_of(valid_characters) != std::string::npos) { - throw std::runtime_error{"Invalid target string: " + x}; + if (t.find(pre) != 0 || t.find_first_not_of(digits, pre.size()) != std::string::npos) { + throw std::runtime_error{"Invalid target: " + t}; } - std::vector r; - - auto it = x.cbegin(); - do { - auto it1 = std::find(it, x.cend(), ','); - r.emplace_back(it, it1); - - if (it1 == x.cend()) break; - - it = ++it1; - } while (true); - - return r; - } - - inline - void validate_targets(const std::vector& x) - { - assert(!x.empty()); - - for (auto&& t : x) { - static const std::string digits{"0123456789"}; - static const std::string pre{"gfx"}; - - if (t.find(pre) != 0 || - t.find_first_not_of(digits, pre.size()) != std::string::npos) { - throw std::runtime_error{"Invalid target: " + t}; - } - - if (amdgpu_targets().find(t) == amdgpu_targets().cend()) { - std::cerr << "Warning: target " << t - << " has not been validated yet; it may be invalid." - << std::endl; - } + if (amdgpu_targets().find(t) == amdgpu_targets().cend()) { + std::cerr << "Warning: target " << t + << " has not been validated yet; it may be invalid." << std::endl; } } -} // Namespace hip_impl. \ No newline at end of file +} +} // Namespace hip_impl. \ No newline at end of file diff --git a/hipamd/lpl_ca/lpl.cpp b/hipamd/lpl_ca/lpl.cpp index 0b99f758c2..e098f22119 100644 --- a/hipamd/lpl_ca/lpl.cpp +++ b/hipamd/lpl_ca/lpl.cpp @@ -11,12 +11,10 @@ using namespace clara; using namespace hip_impl; using namespace std; -int main(int argc, char** argv) -{ +int main(int argc, char** argv) { try { if (!hipcc_and_lpl_colocated()) { - throw runtime_error{ - "The LPL executable and hipcc must be in the same directory."}; + throw runtime_error{"The LPL executable and hipcc must be in the same directory."}; } bool help = false; @@ -31,22 +29,23 @@ int main(int argc, char** argv) if (!r) throw runtime_error{r.errorMessage()}; - if (help) cout << cmd << endl; + if (help) + cout << cmd << endl; else { if (sources.empty()) throw runtime_error{"No inputs specified."}; auto tmp = tokenize_targets(targets); if (tmp.empty()) { tmp.assign(amdgpu_targets().cbegin(), amdgpu_targets().cend()); - } - else validate_targets(tmp); + } else + validate_targets(tmp); - if (output.empty()) for (auto&& x : tmp) output += x; + if (output.empty()) + for (auto&& x : tmp) output += x; generate_fat_binary(sources, tmp, flags, output); } - } - catch (const exception& ex) { + } catch (const exception& ex) { cerr << ex.what() << endl; return EXIT_FAILURE; diff --git a/hipamd/lpl_ca/lpl.hpp b/hipamd/lpl_ca/lpl.hpp index e2b157bb1c..c9346fd793 100644 --- a/hipamd/lpl_ca/lpl.hpp +++ b/hipamd/lpl_ca/lpl.hpp @@ -18,164 +18,123 @@ #include #include -namespace hip_impl -{ - inline - const std::string& kernel_section() - { - static const std::string r{".kernel"}; +namespace hip_impl { +inline const std::string& kernel_section() { + static const std::string r{".kernel"}; - return r; + return r; +} + +inline const std::string& path_to_self() { + static constexpr const char self[] = "/proc/self/exe"; + + static std::string r; + static std::once_flag f; + + std::call_once(f, []() { + using N = decltype(readlink(self, &r.front(), r.size())); + + constexpr decltype(r.size()) max_path_sz{PATH_MAX}; + N read_cnt; + do { + r.resize(std::max(2 * r.size(), max_path_sz)); + read_cnt = readlink(self, &r.front(), r.size()); + } while (read_cnt == -1 && r.size() < r.max_size()); + + r.resize(std::max(read_cnt, N{0})); + }); + + return r; +} + +inline const std::string& path_to_hipcc() { + assert(!path_to_self().empty()); + + static const auto r = path_to_self().substr(0, path_to_self().find_last_of('/')) += "/hipcc"; + + return r; +} + +inline std::string make_hipcc_call(const std::vector& sources, + const std::vector& targets, + const std::string& flags, const std::string& hipcc_output) { + assert(!sources.empty() && !targets.empty() && !hipcc_output.empty()); + + std::string r{path_to_hipcc() + ' '}; + + for (auto&& x : sources) r += x + ' '; + r += "-o " + hipcc_output + ' '; + for (auto&& x : targets) r += "--amdgpu-target=" + x + ' '; + r += flags + " -fPIC -shared"; + + return r; +} + +inline void copy_kernel_section_to_fat_binary(const std::string& tmp, const std::string& output) { + ELFIO::elfio reader; + if (!reader.load(tmp)) { + throw std::runtime_error{"The result of the compilation is inaccessible."}; } - inline - const std::string& path_to_self() - { - static constexpr const char self[] = "/proc/self/exe"; + const auto it = + std::find_if(reader.sections.begin(), reader.sections.end(), + [](const ELFIO::section* x) { return x->get_name() == kernel_section(); }); - static std::string r; - static std::once_flag f; + std::ofstream out{output + fat_binary_extension()}; - std::call_once(f, []() { - using N = decltype(readlink(self, &r.front(), r.size())); + if (it == reader.sections.end()) { + std::cerr << "Warning: no kernels were generated; fat binary shall " + "be empty." + << std::endl; + } else { + std::copy_n((*it)->get_data(), (*it)->get_size(), std::ostreambuf_iterator{out}); + } +} - constexpr decltype(r.size()) max_path_sz{PATH_MAX}; - N read_cnt; - do { - r.resize(std::max(2 * r.size(), max_path_sz)); - read_cnt = readlink(self, &r.front(), r.size()); - } while (read_cnt == -1 && r.size() < r.max_size()); +inline void generate_fat_binary(const std::vector& sources, + const std::vector& targets, const std::string& flags, + const std::string& output) { + static const auto d = [](const std::string* f) { remove(f->c_str()); }; - r.resize(std::max(read_cnt, N{0})); - }); + std::unique_ptr tmp{&output, d}; - return r; + redi::ipstream hipcc{make_hipcc_call(sources, targets, flags, *tmp), redi::pstream::pstderr}; + + if (!hipcc.is_open()) { + throw std::runtime_error{"Compiler invocation failed."}; } - inline - const std::string& path_to_hipcc() - { - assert(!path_to_self().empty()); + std::string log; + while (std::getline(hipcc, log)) std::cout << log << '\n'; - static const auto r = path_to_self().substr( - 0, path_to_self().find_last_of('/')) += "/hipcc"; + hipcc.close(); - return r; + if (hipcc.rdbuf()->exited() && hipcc.rdbuf()->status() != EXIT_SUCCESS) { + throw std::runtime_error{"Compilation failed."}; } - inline - std::string make_hipcc_call( - const std::vector& sources, - const std::vector& targets, - const std::string& flags, - const std::string& hipcc_output) - { - assert(!sources.empty() && !targets.empty() && !hipcc_output.empty()); + copy_kernel_section_to_fat_binary(*tmp, output); +} - std::string r{path_to_hipcc() + ' '}; +inline bool hipcc_and_lpl_colocated() { + if (path_to_self().empty()) return false; - for (auto&& x : sources) r += x + ' '; - r += "-o " + hipcc_output + ' '; - for (auto&& x : targets) r += "--amdgpu-target=" + x + ' '; - r += flags + " -fPIC -shared"; + return file_exists(path_to_hipcc()); +} - return r; - } - - inline - void copy_kernel_section_to_fat_binary( - const std::string& tmp, const std::string& output) - { - ELFIO::elfio reader; - if (!reader.load(tmp)) { - throw std::runtime_error{ - "The result of the compilation is inaccessible."}; - } - - const auto it = std::find_if( - reader.sections.begin(), - reader.sections.end(), - [](const ELFIO::section* x) { - return x->get_name() == kernel_section(); - }); - - std::ofstream out{output + fat_binary_extension()}; - - if (it == reader.sections.end()) { - std::cerr << "Warning: no kernels were generated; fat binary shall " - "be empty." << std::endl; - } - else { - std::copy_n( - (*it)->get_data(), - (*it)->get_size(), - std::ostreambuf_iterator{out}); - } - } - - inline - void generate_fat_binary( - const std::vector& sources, - const std::vector& targets, - const std::string& flags, - const std::string& output) - { - static const auto d = [](const std::string* f) { remove(f->c_str()); }; - - std::unique_ptr tmp{&output, d}; - - redi::ipstream hipcc{ - make_hipcc_call(sources, targets, flags, *tmp), - redi::pstream::pstderr}; - - if (!hipcc.is_open()) { - throw std::runtime_error{"Compiler invocation failed."}; - } - - std::string log; - while (std::getline(hipcc, log)) std::cout << log << '\n'; - - hipcc.close(); - - if (hipcc.rdbuf()->exited() && - hipcc.rdbuf()->status() != EXIT_SUCCESS) { - throw std::runtime_error{"Compilation failed."}; - } - - copy_kernel_section_to_fat_binary(*tmp, output); - } - - inline - bool hipcc_and_lpl_colocated() - { - if (path_to_self().empty()) return false; - - return file_exists(path_to_hipcc()); - } - - inline - clara::Parser cmdline_parser( - bool& help, - std::vector& sources, - std::string& targets, - std::string& flags, - std::string& output) - { - return - clara::Opt{flags, "\"-v -DMACRO etc.\""} - ["-f"]["--flags"]( - "flags for compilation; must be valid for hipcc.") | - clara::Help{help} | - clara::Opt{output, "filename"} - ["-o"]["--output"]( - "name of fat-binary output file; the binary format of the " - "file is documented at: https://reviews.llvm.org/D13909.") | - clara::Arg{sources, "a.cpp b.cpp etc."}( - "inputs for compilation; must contain valid C++ code.") | - clara::Opt{targets, "gfx803,gfx900 etc."} - ["-t"]["--targets"]( - "targets for AMDGPU lowering; must be included in the set " - "of processors with ROCm support from " - "https://www.llvm.org/docs/AMDGPUUsage.html#processors."); - } -} \ No newline at end of file +inline clara::Parser cmdline_parser(bool& help, std::vector& sources, + std::string& targets, std::string& flags, std::string& output) { + return clara::Opt{flags, "\"-v -DMACRO etc.\""}["-f"]["--flags"]( + "flags for compilation; must be valid for hipcc.") | + clara::Help{help} | + clara::Opt{output, "filename"}["-o"]["--output"]( + "name of fat-binary output file; the binary format of the " + "file is documented at: https://reviews.llvm.org/D13909.") | + clara::Arg{sources, + "a.cpp b.cpp etc."}("inputs for compilation; must contain valid C++ code.") | + clara::Opt{targets, "gfx803,gfx900 etc."}["-t"]["--targets"]( + "targets for AMDGPU lowering; must be included in the set " + "of processors with ROCm support from " + "https://www.llvm.org/docs/AMDGPUUsage.html#processors."); +} +} // namespace hip_impl \ No newline at end of file diff --git a/hipamd/lpl_ca/pstreams/pstream.h b/hipamd/lpl_ca/pstreams/pstream.h index 28cbeadb1e..363df0cf45 100644 --- a/hipamd/lpl_ca/pstreams/pstream.h +++ b/hipamd/lpl_ca/pstreams/pstream.h @@ -32,18 +32,18 @@ #include // for waitpid() #include // for ioctl() and FIONREAD #if defined(__sun) -# include // for FIONREAD on Solaris 2.5 +#include // for FIONREAD on Solaris 2.5 #endif -#include // for pipe() fork() exec() and filedes functions -#include // for kill() -#include // for fcntl() +#include // for pipe() fork() exec() and filedes functions +#include // for kill() +#include // for fcntl() #if REDI_EVISCERATE_PSTREAMS -# include // for FILE, fdopen() +#include // for FILE, fdopen() #endif /// The library version. -#define PSTREAMS_VERSION 0x0101 // 1.0.1 +#define PSTREAMS_VERSION 0x0101 // 1.0.1 /** * @namespace redi @@ -58,2191 +58,1853 @@ * it is used internally to provide the common functionality for the * other stream classes. */ -namespace redi -{ - /// Common base class providing constants and typenames. - struct pstreams - { +namespace redi { +/// Common base class providing constants and typenames. +struct pstreams { /// Type used to specify how to connect to the process. - typedef std::ios_base::openmode pmode; + typedef std::ios_base::openmode pmode; /// Type used to hold the arguments for a command. - typedef std::vector argv_type; + typedef std::vector argv_type; /// Type used for file descriptors. - typedef int fd_type; + typedef int fd_type; - static const pmode pstdin = std::ios_base::out; ///< Write to stdin - static const pmode pstdout = std::ios_base::in; ///< Read from stdout - static const pmode pstderr = std::ios_base::app; ///< Read from stderr + static const pmode pstdin = std::ios_base::out; ///< Write to stdin + static const pmode pstdout = std::ios_base::in; ///< Read from stdout + static const pmode pstderr = std::ios_base::app; ///< Read from stderr /// Create a new process group for the child process. - static const pmode newpg = std::ios_base::trunc; + static const pmode newpg = std::ios_base::trunc; - protected: + protected: enum { bufsz = 32 }; ///< Size of pstreambuf buffers. - enum { pbsz = 2 }; ///< Number of putback characters kept. - }; + enum { pbsz = 2 }; ///< Number of putback characters kept. +}; - /// Class template for stream buffer. - template > - class basic_pstreambuf - : public std::basic_streambuf - , public pstreams - { - public: - // Type definitions for dependent types - typedef CharT char_type; - typedef Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::off_type off_type; - typedef typename traits_type::pos_type pos_type; - /** @deprecated use pstreams::fd_type instead. */ - typedef fd_type fd_t; +/// Class template for stream buffer. +template > +class basic_pstreambuf : public std::basic_streambuf, public pstreams { + public: + // Type definitions for dependent types + typedef CharT char_type; + typedef Traits traits_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::off_type off_type; + typedef typename traits_type::pos_type pos_type; + /** @deprecated use pstreams::fd_type instead. */ + typedef fd_type fd_t; - /// Default constructor. - basic_pstreambuf(); + /// Default constructor. + basic_pstreambuf(); - /// Constructor that initialises the buffer with @a cmd. - basic_pstreambuf(const std::string& cmd, pmode mode); + /// Constructor that initialises the buffer with @a cmd. + basic_pstreambuf(const std::string& cmd, pmode mode); - /// Constructor that initialises the buffer with @a file and @a argv. - basic_pstreambuf( const std::string& file, - const argv_type& argv, - pmode mode ); + /// Constructor that initialises the buffer with @a file and @a argv. + basic_pstreambuf(const std::string& file, const argv_type& argv, pmode mode); - /// Destructor. - ~basic_pstreambuf(); + /// Destructor. + ~basic_pstreambuf(); - /// Initialise the stream buffer with @a cmd. - basic_pstreambuf* - open(const std::string& cmd, pmode mode); + /// Initialise the stream buffer with @a cmd. + basic_pstreambuf* open(const std::string& cmd, pmode mode); - /// Initialise the stream buffer with @a file and @a argv. - basic_pstreambuf* - open(const std::string& file, const argv_type& argv, pmode mode); + /// Initialise the stream buffer with @a file and @a argv. + basic_pstreambuf* open(const std::string& file, const argv_type& argv, pmode mode); - /// Close the stream buffer and wait for the process to exit. - basic_pstreambuf* - close(); + /// Close the stream buffer and wait for the process to exit. + basic_pstreambuf* close(); - /// Send a signal to the process. - basic_pstreambuf* - kill(int signal = SIGTERM); + /// Send a signal to the process. + basic_pstreambuf* kill(int signal = SIGTERM); - /// Send a signal to the process' process group. - basic_pstreambuf* - killpg(int signal = SIGTERM); + /// Send a signal to the process' process group. + basic_pstreambuf* killpg(int signal = SIGTERM); - /// Close the pipe connected to the process' stdin. - void - peof(); + /// Close the pipe connected to the process' stdin. + void peof(); - /// Change active input source. - bool - read_err(bool readerr = true); + /// Change active input source. + bool read_err(bool readerr = true); - /// Report whether the stream buffer has been initialised. - bool - is_open() const; + /// Report whether the stream buffer has been initialised. + bool is_open() const; - /// Report whether the process has exited. - bool - exited(); + /// Report whether the process has exited. + bool exited(); #if REDI_EVISCERATE_PSTREAMS - /// Obtain FILE pointers for each of the process' standard streams. - std::size_t - fopen(FILE*& in, FILE*& out, FILE*& err); + /// Obtain FILE pointers for each of the process' standard streams. + std::size_t fopen(FILE*& in, FILE*& out, FILE*& err); #endif - /// Return the exit status of the process. - int - status() const; + /// Return the exit status of the process. + int status() const; - /// Return the error number (errno) for the most recent failed operation. - int - error() const; + /// Return the error number (errno) for the most recent failed operation. + int error() const; - protected: - /// Transfer characters to the pipe when character buffer overflows. - int_type - overflow(int_type c); + protected: + /// Transfer characters to the pipe when character buffer overflows. + int_type overflow(int_type c); - /// Transfer characters from the pipe when the character buffer is empty. - int_type - underflow(); + /// Transfer characters from the pipe when the character buffer is empty. + int_type underflow(); - /// Make a character available to be returned by the next extraction. - int_type - pbackfail(int_type c = traits_type::eof()); + /// Make a character available to be returned by the next extraction. + int_type pbackfail(int_type c = traits_type::eof()); - /// Write any buffered characters to the stream. - int - sync(); + /// Write any buffered characters to the stream. + int sync(); - /// Insert multiple characters into the pipe. - std::streamsize - xsputn(const char_type* s, std::streamsize n); + /// Insert multiple characters into the pipe. + std::streamsize xsputn(const char_type* s, std::streamsize n); - /// Insert a sequence of characters into the pipe. - std::streamsize - write(const char_type* s, std::streamsize n); + /// Insert a sequence of characters into the pipe. + std::streamsize write(const char_type* s, std::streamsize n); - /// Extract a sequence of characters from the pipe. - std::streamsize - read(char_type* s, std::streamsize n); + /// Extract a sequence of characters from the pipe. + std::streamsize read(char_type* s, std::streamsize n); - /// Report how many characters can be read from active input without blocking. - std::streamsize - showmanyc(); + /// Report how many characters can be read from active input without blocking. + std::streamsize showmanyc(); - protected: - /// Enumerated type to indicate whether stdout or stderr is to be read. - enum buf_read_src { rsrc_out = 0, rsrc_err = 1 }; + protected: + /// Enumerated type to indicate whether stdout or stderr is to be read. + enum buf_read_src { rsrc_out = 0, rsrc_err = 1 }; - /// Initialise pipes and fork process. - pid_t - fork(pmode mode); + /// Initialise pipes and fork process. + pid_t fork(pmode mode); - /// Wait for the child process to exit. - int - wait(bool nohang = false); + /// Wait for the child process to exit. + int wait(bool nohang = false); - /// Return the file descriptor for the output pipe. - fd_type& - wpipe(); + /// Return the file descriptor for the output pipe. + fd_type& wpipe(); - /// Return the file descriptor for the active input pipe. - fd_type& - rpipe(); + /// Return the file descriptor for the active input pipe. + fd_type& rpipe(); - /// Return the file descriptor for the specified input pipe. - fd_type& - rpipe(buf_read_src which); + /// Return the file descriptor for the specified input pipe. + fd_type& rpipe(buf_read_src which); - void - create_buffers(pmode mode); + void create_buffers(pmode mode); - void - destroy_buffers(pmode mode); + void destroy_buffers(pmode mode); - /// Writes buffered characters to the process' stdin pipe. - bool - empty_buffer(); + /// Writes buffered characters to the process' stdin pipe. + bool empty_buffer(); - bool - fill_buffer(bool non_blocking = false); + bool fill_buffer(bool non_blocking = false); - /// Return the active input buffer. - char_type* - rbuffer(); + /// Return the active input buffer. + char_type* rbuffer(); - buf_read_src - switch_read_buffer(buf_read_src); + buf_read_src switch_read_buffer(buf_read_src); - private: - basic_pstreambuf(const basic_pstreambuf&); - basic_pstreambuf& operator=(const basic_pstreambuf&); + private: + basic_pstreambuf(const basic_pstreambuf&); + basic_pstreambuf& operator=(const basic_pstreambuf&); - void - init_rbuffers(); + void init_rbuffers(); - pid_t ppid_; // pid of process - fd_type wpipe_; // pipe used to write to process' stdin - fd_type rpipe_[2]; // two pipes to read from, stdout and stderr - char_type* wbuffer_; - char_type* rbuffer_[2]; - char_type* rbufstate_[3]; - /// Index into rpipe_[] to indicate active source for read operations. - buf_read_src rsrc_; - int status_; // hold exit status of child process - int error_; // hold errno if fork() or exec() fails - }; + pid_t ppid_; // pid of process + fd_type wpipe_; // pipe used to write to process' stdin + fd_type rpipe_[2]; // two pipes to read from, stdout and stderr + char_type* wbuffer_; + char_type* rbuffer_[2]; + char_type* rbufstate_[3]; + /// Index into rpipe_[] to indicate active source for read operations. + buf_read_src rsrc_; + int status_; // hold exit status of child process + int error_; // hold errno if fork() or exec() fails +}; - /// Class template for common base class. - template > - class pstream_common - : virtual public std::basic_ios - , virtual public pstreams - { - protected: - typedef basic_pstreambuf streambuf_type; +/// Class template for common base class. +template > +class pstream_common : virtual public std::basic_ios, virtual public pstreams { + protected: + typedef basic_pstreambuf streambuf_type; - typedef pstreams::pmode pmode; - typedef pstreams::argv_type argv_type; + typedef pstreams::pmode pmode; + typedef pstreams::argv_type argv_type; - /// Default constructor. - pstream_common(); + /// Default constructor. + pstream_common(); - /// Constructor that initialises the stream by starting a process. - pstream_common(const std::string& cmd, pmode mode); + /// Constructor that initialises the stream by starting a process. + pstream_common(const std::string& cmd, pmode mode); - /// Constructor that initialises the stream by starting a process. - pstream_common(const std::string& file, const argv_type& argv, pmode mode); + /// Constructor that initialises the stream by starting a process. + pstream_common(const std::string& file, const argv_type& argv, pmode mode); - /// Pure virtual destructor. - virtual - ~pstream_common() = 0; + /// Pure virtual destructor. + virtual ~pstream_common() = 0; - /// Start a process. - void - do_open(const std::string& cmd, pmode mode); + /// Start a process. + void do_open(const std::string& cmd, pmode mode); - /// Start a process. - void - do_open(const std::string& file, const argv_type& argv, pmode mode); + /// Start a process. + void do_open(const std::string& file, const argv_type& argv, pmode mode); - public: - /// Close the pipe. - void - close(); + public: + /// Close the pipe. + void close(); - /// Report whether the stream's buffer has been initialised. - bool - is_open() const; + /// Report whether the stream's buffer has been initialised. + bool is_open() const; - /// Return the command used to initialise the stream. - const std::string& - command() const; + /// Return the command used to initialise the stream. + const std::string& command() const; - /// Return a pointer to the stream buffer. - streambuf_type* - rdbuf() const; + /// Return a pointer to the stream buffer. + streambuf_type* rdbuf() const; #if REDI_EVISCERATE_PSTREAMS - /// Obtain FILE pointers for each of the process' standard streams. - std::size_t - fopen(FILE*& in, FILE*& out, FILE*& err); + /// Obtain FILE pointers for each of the process' standard streams. + std::size_t fopen(FILE*& in, FILE*& out, FILE*& err); #endif - protected: - std::string command_; ///< The command used to start the process. - streambuf_type buf_; ///< The stream buffer. - }; + protected: + std::string command_; ///< The command used to start the process. + streambuf_type buf_; ///< The stream buffer. +}; - /** - * @class basic_ipstream - * @brief Class template for Input PStreams. - * - * Reading from an ipstream reads the command's standard output and/or - * standard error (depending on how the ipstream is opened) - * and the command's standard input is the same as that of the process - * that created the object, unless altered by the command itself. - */ +/** + * @class basic_ipstream + * @brief Class template for Input PStreams. + * + * Reading from an ipstream reads the command's standard output and/or + * standard error (depending on how the ipstream is opened) + * and the command's standard input is the same as that of the process + * that created the object, unless altered by the command itself. + */ - template > - class basic_ipstream - : public std::basic_istream - , public pstream_common - , virtual public pstreams - { - typedef std::basic_istream istream_type; - typedef pstream_common pbase_type; +template > +class basic_ipstream : public std::basic_istream, + public pstream_common, + virtual public pstreams { + typedef std::basic_istream istream_type; + typedef pstream_common pbase_type; - using pbase_type::buf_; // declare name in this scope + using pbase_type::buf_; // declare name in this scope - // Ensure a basic_ipstream will read from at least one pipe - pmode readable(pmode mode) - { - if (!(mode & (pstdout|pstderr))) - mode |= pstdout; + // Ensure a basic_ipstream will read from at least one pipe + pmode readable(pmode mode) { + if (!(mode & (pstdout | pstderr))) mode |= pstdout; return mode; - } + } - public: - /// Type used to specify how to connect to the process. - typedef typename pbase_type::pmode pmode; + public: + /// Type used to specify how to connect to the process. + typedef typename pbase_type::pmode pmode; - /// Type used to hold the arguments for a command. - typedef typename pbase_type::argv_type argv_type; + /// Type used to hold the arguments for a command. + typedef typename pbase_type::argv_type argv_type; - /// Default constructor, creates an uninitialised stream. - basic_ipstream() - : istream_type(NULL), pbase_type() - { } + /// Default constructor, creates an uninitialised stream. + basic_ipstream() : istream_type(NULL), pbase_type() {} - /** - * @brief Constructor that initialises the stream by starting a process. - * - * Initialises the stream buffer by calling do_open() with the supplied - * arguments. - * - * @param cmd a string containing a shell command. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, pmode) - */ - explicit - basic_ipstream(const std::string& cmd, pmode mode = pstdout) - : istream_type(NULL), pbase_type(cmd, readable(mode)) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * Initialises the stream buffer by calling do_open() with the supplied + * arguments. + * + * @param cmd a string containing a shell command. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, pmode) + */ + explicit basic_ipstream(const std::string& cmd, pmode mode = pstdout) + : istream_type(NULL), pbase_type(cmd, readable(mode)) {} - /** - * @brief Constructor that initialises the stream by starting a process. - * - * Initialises the stream buffer by calling do_open() with the supplied - * arguments. - * - * @param file a string containing the pathname of a program to execute. - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - basic_ipstream( const std::string& file, - const argv_type& argv, - pmode mode = pstdout ) - : istream_type(NULL), pbase_type(file, argv, readable(mode)) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * Initialises the stream buffer by calling do_open() with the supplied + * arguments. + * + * @param file a string containing the pathname of a program to execute. + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + basic_ipstream(const std::string& file, const argv_type& argv, pmode mode = pstdout) + : istream_type(NULL), pbase_type(file, argv, readable(mode)) {} - /** - * @brief Constructor that initialises the stream by starting a process. - * - * Initialises the stream buffer by calling - * @c do_open(argv[0],argv,mode|pstdout) - * - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - explicit - basic_ipstream(const argv_type& argv, pmode mode = pstdout) - : istream_type(NULL), pbase_type(argv.at(0), argv, readable(mode)) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * Initialises the stream buffer by calling + * @c do_open(argv[0],argv,mode|pstdout) + * + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + explicit basic_ipstream(const argv_type& argv, pmode mode = pstdout) + : istream_type(NULL), pbase_type(argv.at(0), argv, readable(mode)) {} #if __cplusplus >= 201103L - template - explicit - basic_ipstream(std::initializer_list args, pmode mode = pstdout) - : basic_ipstream(argv_type(args.begin(), args.end()), mode) - { } + template + explicit basic_ipstream(std::initializer_list args, pmode mode = pstdout) + : basic_ipstream(argv_type(args.begin(), args.end()), mode) {} #endif - /** - * @brief Destructor. - * - * Closes the stream and waits for the child to exit. - */ - ~basic_ipstream() - { } + /** + * @brief Destructor. + * + * Closes the stream and waits for the child to exit. + */ + ~basic_ipstream() {} - /** - * @brief Start a process. - * - * Calls do_open( @a cmd , @a mode|pstdout ). - * - * @param cmd a string containing a shell command. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, pmode) - */ - void - open(const std::string& cmd, pmode mode = pstdout) - { - this->do_open(cmd, readable(mode)); - } + /** + * @brief Start a process. + * + * Calls do_open( @a cmd , @a mode|pstdout ). + * + * @param cmd a string containing a shell command. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, pmode) + */ + void open(const std::string& cmd, pmode mode = pstdout) { this->do_open(cmd, readable(mode)); } - /** - * @brief Start a process. - * - * Calls do_open( @a file , @a argv , @a mode|pstdout ). - * - * @param file a string containing the pathname of a program to execute. - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - void - open( const std::string& file, - const argv_type& argv, - pmode mode = pstdout ) - { + /** + * @brief Start a process. + * + * Calls do_open( @a file , @a argv , @a mode|pstdout ). + * + * @param file a string containing the pathname of a program to execute. + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + void open(const std::string& file, const argv_type& argv, pmode mode = pstdout) { this->do_open(file, argv, readable(mode)); - } + } - /** - * @brief Set streambuf to read from process' @c stdout. - * @return @c *this - */ - basic_ipstream& - out() - { + /** + * @brief Set streambuf to read from process' @c stdout. + * @return @c *this + */ + basic_ipstream& out() { this->buf_.read_err(false); return *this; - } + } - /** - * @brief Set streambuf to read from process' @c stderr. - * @return @c *this - */ - basic_ipstream& - err() - { + /** + * @brief Set streambuf to read from process' @c stderr. + * @return @c *this + */ + basic_ipstream& err() { this->buf_.read_err(true); return *this; - } - }; + } +}; - /** - * @class basic_opstream - * @brief Class template for Output PStreams. - * - * Writing to an open opstream writes to the standard input of the command; - * the command's standard output is the same as that of the process that - * created the pstream object, unless altered by the command itself. - */ +/** + * @class basic_opstream + * @brief Class template for Output PStreams. + * + * Writing to an open opstream writes to the standard input of the command; + * the command's standard output is the same as that of the process that + * created the pstream object, unless altered by the command itself. + */ - template > - class basic_opstream - : public std::basic_ostream - , public pstream_common - , virtual public pstreams - { - typedef std::basic_ostream ostream_type; - typedef pstream_common pbase_type; +template > +class basic_opstream : public std::basic_ostream, + public pstream_common, + virtual public pstreams { + typedef std::basic_ostream ostream_type; + typedef pstream_common pbase_type; - using pbase_type::buf_; // declare name in this scope + using pbase_type::buf_; // declare name in this scope - public: - /// Type used to specify how to connect to the process. - typedef typename pbase_type::pmode pmode; + public: + /// Type used to specify how to connect to the process. + typedef typename pbase_type::pmode pmode; - /// Type used to hold the arguments for a command. - typedef typename pbase_type::argv_type argv_type; + /// Type used to hold the arguments for a command. + typedef typename pbase_type::argv_type argv_type; - /// Default constructor, creates an uninitialised stream. - basic_opstream() - : ostream_type(NULL), pbase_type() - { } + /// Default constructor, creates an uninitialised stream. + basic_opstream() : ostream_type(NULL), pbase_type() {} - /** - * @brief Constructor that initialises the stream by starting a process. - * - * Initialises the stream buffer by calling do_open() with the supplied - * arguments. - * - * @param cmd a string containing a shell command. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, pmode) - */ - explicit - basic_opstream(const std::string& cmd, pmode mode = pstdin) - : ostream_type(NULL), pbase_type(cmd, mode|pstdin) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * Initialises the stream buffer by calling do_open() with the supplied + * arguments. + * + * @param cmd a string containing a shell command. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, pmode) + */ + explicit basic_opstream(const std::string& cmd, pmode mode = pstdin) + : ostream_type(NULL), pbase_type(cmd, mode | pstdin) {} - /** - * @brief Constructor that initialises the stream by starting a process. - * - * Initialises the stream buffer by calling do_open() with the supplied - * arguments. - * - * @param file a string containing the pathname of a program to execute. - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - basic_opstream( const std::string& file, - const argv_type& argv, - pmode mode = pstdin ) - : ostream_type(NULL), pbase_type(file, argv, mode|pstdin) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * Initialises the stream buffer by calling do_open() with the supplied + * arguments. + * + * @param file a string containing the pathname of a program to execute. + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + basic_opstream(const std::string& file, const argv_type& argv, pmode mode = pstdin) + : ostream_type(NULL), pbase_type(file, argv, mode | pstdin) {} - /** - * @brief Constructor that initialises the stream by starting a process. - * - * Initialises the stream buffer by calling - * @c do_open(argv[0],argv,mode|pstdin) - * - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - explicit - basic_opstream(const argv_type& argv, pmode mode = pstdin) - : ostream_type(NULL), pbase_type(argv.at(0), argv, mode|pstdin) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * Initialises the stream buffer by calling + * @c do_open(argv[0],argv,mode|pstdin) + * + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + explicit basic_opstream(const argv_type& argv, pmode mode = pstdin) + : ostream_type(NULL), pbase_type(argv.at(0), argv, mode | pstdin) {} #if __cplusplus >= 201103L - /** - * @brief Constructor that initialises the stream by starting a process. - * - * @param args a list of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - template - explicit - basic_opstream(std::initializer_list args, pmode mode = pstdin) - : basic_opstream(argv_type(args.begin(), args.end()), mode) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * @param args a list of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + template + explicit basic_opstream(std::initializer_list args, pmode mode = pstdin) + : basic_opstream(argv_type(args.begin(), args.end()), mode) {} #endif - /** - * @brief Destructor - * - * Closes the stream and waits for the child to exit. - */ - ~basic_opstream() { } + /** + * @brief Destructor + * + * Closes the stream and waits for the child to exit. + */ + ~basic_opstream() {} - /** - * @brief Start a process. - * - * Calls do_open( @a cmd , @a mode|pstdin ). - * - * @param cmd a string containing a shell command. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, pmode) - */ - void - open(const std::string& cmd, pmode mode = pstdin) - { - this->do_open(cmd, mode|pstdin); - } + /** + * @brief Start a process. + * + * Calls do_open( @a cmd , @a mode|pstdin ). + * + * @param cmd a string containing a shell command. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, pmode) + */ + void open(const std::string& cmd, pmode mode = pstdin) { this->do_open(cmd, mode | pstdin); } - /** - * @brief Start a process. - * - * Calls do_open( @a file , @a argv , @a mode|pstdin ). - * - * @param file a string containing the pathname of a program to execute. - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - void - open( const std::string& file, - const argv_type& argv, - pmode mode = pstdin) - { - this->do_open(file, argv, mode|pstdin); - } - }; + /** + * @brief Start a process. + * + * Calls do_open( @a file , @a argv , @a mode|pstdin ). + * + * @param file a string containing the pathname of a program to execute. + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + void open(const std::string& file, const argv_type& argv, pmode mode = pstdin) { + this->do_open(file, argv, mode | pstdin); + } +}; - /** - * @class basic_pstream - * @brief Class template for Bidirectional PStreams. - * - * Writing to a pstream opened with @c pmode @c pstdin writes to the - * standard input of the command. - * Reading from a pstream opened with @c pmode @c pstdout and/or @c pstderr - * reads the command's standard output and/or standard error. - * Any of the process' @c stdin, @c stdout or @c stderr that is not - * connected to the pstream (as specified by the @c pmode) - * will be the same as the process that created the pstream object, - * unless altered by the command itself. - */ - template > - class basic_pstream - : public std::basic_iostream - , public pstream_common - , virtual public pstreams - { - typedef std::basic_iostream iostream_type; - typedef pstream_common pbase_type; +/** + * @class basic_pstream + * @brief Class template for Bidirectional PStreams. + * + * Writing to a pstream opened with @c pmode @c pstdin writes to the + * standard input of the command. + * Reading from a pstream opened with @c pmode @c pstdout and/or @c pstderr + * reads the command's standard output and/or standard error. + * Any of the process' @c stdin, @c stdout or @c stderr that is not + * connected to the pstream (as specified by the @c pmode) + * will be the same as the process that created the pstream object, + * unless altered by the command itself. + */ +template > +class basic_pstream : public std::basic_iostream, + public pstream_common, + virtual public pstreams { + typedef std::basic_iostream iostream_type; + typedef pstream_common pbase_type; - using pbase_type::buf_; // declare name in this scope + using pbase_type::buf_; // declare name in this scope - public: - /// Type used to specify how to connect to the process. - typedef typename pbase_type::pmode pmode; + public: + /// Type used to specify how to connect to the process. + typedef typename pbase_type::pmode pmode; - /// Type used to hold the arguments for a command. - typedef typename pbase_type::argv_type argv_type; + /// Type used to hold the arguments for a command. + typedef typename pbase_type::argv_type argv_type; - /// Default constructor, creates an uninitialised stream. - basic_pstream() - : iostream_type(NULL), pbase_type() - { } + /// Default constructor, creates an uninitialised stream. + basic_pstream() : iostream_type(NULL), pbase_type() {} - /** - * @brief Constructor that initialises the stream by starting a process. - * - * Initialises the stream buffer by calling do_open() with the supplied - * arguments. - * - * @param cmd a string containing a shell command. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, pmode) - */ - explicit - basic_pstream(const std::string& cmd, pmode mode = pstdout|pstdin) - : iostream_type(NULL), pbase_type(cmd, mode) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * Initialises the stream buffer by calling do_open() with the supplied + * arguments. + * + * @param cmd a string containing a shell command. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, pmode) + */ + explicit basic_pstream(const std::string& cmd, pmode mode = pstdout | pstdin) + : iostream_type(NULL), pbase_type(cmd, mode) {} - /** - * @brief Constructor that initialises the stream by starting a process. - * - * Initialises the stream buffer by calling do_open() with the supplied - * arguments. - * - * @param file a string containing the pathname of a program to execute. - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - basic_pstream( const std::string& file, - const argv_type& argv, - pmode mode = pstdout|pstdin ) - : iostream_type(NULL), pbase_type(file, argv, mode) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * Initialises the stream buffer by calling do_open() with the supplied + * arguments. + * + * @param file a string containing the pathname of a program to execute. + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + basic_pstream(const std::string& file, const argv_type& argv, pmode mode = pstdout | pstdin) + : iostream_type(NULL), pbase_type(file, argv, mode) {} - /** - * @brief Constructor that initialises the stream by starting a process. - * - * Initialises the stream buffer by calling - * @c do_open(argv[0],argv,mode) - * - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - explicit - basic_pstream(const argv_type& argv, pmode mode = pstdout|pstdin) - : iostream_type(NULL), pbase_type(argv.at(0), argv, mode) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * Initialises the stream buffer by calling + * @c do_open(argv[0],argv,mode) + * + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + explicit basic_pstream(const argv_type& argv, pmode mode = pstdout | pstdin) + : iostream_type(NULL), pbase_type(argv.at(0), argv, mode) {} #if __cplusplus >= 201103L - /** - * @brief Constructor that initialises the stream by starting a process. - * - * @param l a list of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - template - explicit - basic_pstream(std::initializer_list l, pmode mode = pstdout|pstdin) - : basic_pstream(argv_type(l.begin(), l.end()), mode) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * @param l a list of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + template + explicit basic_pstream(std::initializer_list l, pmode mode = pstdout | pstdin) + : basic_pstream(argv_type(l.begin(), l.end()), mode) {} #endif - /** - * @brief Destructor - * - * Closes the stream and waits for the child to exit. - */ - ~basic_pstream() { } + /** + * @brief Destructor + * + * Closes the stream and waits for the child to exit. + */ + ~basic_pstream() {} - /** - * @brief Start a process. - * - * Calls do_open( @a cnd , @a mode ). - * - * @param cmd a string containing a shell command. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, pmode) - */ - void - open(const std::string& cmd, pmode mode = pstdout|pstdin) - { - this->do_open(cmd, mode); - } + /** + * @brief Start a process. + * + * Calls do_open( @a cnd , @a mode ). + * + * @param cmd a string containing a shell command. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, pmode) + */ + void open(const std::string& cmd, pmode mode = pstdout | pstdin) { this->do_open(cmd, mode); } - /** - * @brief Start a process. - * - * Calls do_open( @a file , @a argv , @a mode ). - * - * @param file a string containing the pathname of a program to execute. - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - void - open( const std::string& file, - const argv_type& argv, - pmode mode = pstdout|pstdin ) - { + /** + * @brief Start a process. + * + * Calls do_open( @a file , @a argv , @a mode ). + * + * @param file a string containing the pathname of a program to execute. + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + void open(const std::string& file, const argv_type& argv, pmode mode = pstdout | pstdin) { this->do_open(file, argv, mode); - } + } - /** - * @brief Set streambuf to read from process' @c stdout. - * @return @c *this - */ - basic_pstream& - out() - { + /** + * @brief Set streambuf to read from process' @c stdout. + * @return @c *this + */ + basic_pstream& out() { this->buf_.read_err(false); return *this; - } + } - /** - * @brief Set streambuf to read from process' @c stderr. - * @return @c *this - */ - basic_pstream& - err() - { + /** + * @brief Set streambuf to read from process' @c stderr. + * @return @c *this + */ + basic_pstream& err() { this->buf_.read_err(true); return *this; - } - }; + } +}; - /** - * @class basic_rpstream - * @brief Class template for Restricted PStreams. - * - * Writing to an rpstream opened with @c pmode @c pstdin writes to the - * standard input of the command. - * It is not possible to read directly from an rpstream object, to use - * an rpstream as in istream you must call either basic_rpstream::out() - * or basic_rpstream::err(). This is to prevent accidental reads from - * the wrong input source. If the rpstream was not opened with @c pmode - * @c pstderr then the class cannot read the process' @c stderr, and - * basic_rpstream::err() will return an istream that reads from the - * process' @c stdout, and vice versa. - * Reading from an rpstream opened with @c pmode @c pstdout and/or - * @c pstderr reads the command's standard output and/or standard error. - * Any of the process' @c stdin, @c stdout or @c stderr that is not - * connected to the pstream (as specified by the @c pmode) - * will be the same as the process that created the pstream object, - * unless altered by the command itself. - */ +/** + * @class basic_rpstream + * @brief Class template for Restricted PStreams. + * + * Writing to an rpstream opened with @c pmode @c pstdin writes to the + * standard input of the command. + * It is not possible to read directly from an rpstream object, to use + * an rpstream as in istream you must call either basic_rpstream::out() + * or basic_rpstream::err(). This is to prevent accidental reads from + * the wrong input source. If the rpstream was not opened with @c pmode + * @c pstderr then the class cannot read the process' @c stderr, and + * basic_rpstream::err() will return an istream that reads from the + * process' @c stdout, and vice versa. + * Reading from an rpstream opened with @c pmode @c pstdout and/or + * @c pstderr reads the command's standard output and/or standard error. + * Any of the process' @c stdin, @c stdout or @c stderr that is not + * connected to the pstream (as specified by the @c pmode) + * will be the same as the process that created the pstream object, + * unless altered by the command itself. + */ - template > - class basic_rpstream - : public std::basic_ostream - , private std::basic_istream - , private pstream_common - , virtual public pstreams - { - typedef std::basic_ostream ostream_type; - typedef std::basic_istream istream_type; - typedef pstream_common pbase_type; +template > +class basic_rpstream : public std::basic_ostream, + private std::basic_istream, + private pstream_common, + virtual public pstreams { + typedef std::basic_ostream ostream_type; + typedef std::basic_istream istream_type; + typedef pstream_common pbase_type; - using pbase_type::buf_; // declare name in this scope + using pbase_type::buf_; // declare name in this scope - public: - /// Type used to specify how to connect to the process. - typedef typename pbase_type::pmode pmode; + public: + /// Type used to specify how to connect to the process. + typedef typename pbase_type::pmode pmode; - /// Type used to hold the arguments for a command. - typedef typename pbase_type::argv_type argv_type; + /// Type used to hold the arguments for a command. + typedef typename pbase_type::argv_type argv_type; - /// Default constructor, creates an uninitialised stream. - basic_rpstream() - : ostream_type(NULL), istream_type(NULL), pbase_type() - { } + /// Default constructor, creates an uninitialised stream. + basic_rpstream() : ostream_type(NULL), istream_type(NULL), pbase_type() {} - /** - * @brief Constructor that initialises the stream by starting a process. - * - * Initialises the stream buffer by calling do_open() with the supplied - * arguments. - * - * @param cmd a string containing a shell command. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, pmode) - */ - explicit - basic_rpstream(const std::string& cmd, pmode mode = pstdout|pstdin) - : ostream_type(NULL) , istream_type(NULL) , pbase_type(cmd, mode) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * Initialises the stream buffer by calling do_open() with the supplied + * arguments. + * + * @param cmd a string containing a shell command. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, pmode) + */ + explicit basic_rpstream(const std::string& cmd, pmode mode = pstdout | pstdin) + : ostream_type(NULL), istream_type(NULL), pbase_type(cmd, mode) {} - /** - * @brief Constructor that initialises the stream by starting a process. - * - * Initialises the stream buffer by calling do_open() with the supplied - * arguments. - * - * @param file a string containing the pathname of a program to execute. - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - basic_rpstream( const std::string& file, - const argv_type& argv, - pmode mode = pstdout|pstdin ) - : ostream_type(NULL), istream_type(NULL), pbase_type(file, argv, mode) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * Initialises the stream buffer by calling do_open() with the supplied + * arguments. + * + * @param file a string containing the pathname of a program to execute. + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + basic_rpstream(const std::string& file, const argv_type& argv, pmode mode = pstdout | pstdin) + : ostream_type(NULL), istream_type(NULL), pbase_type(file, argv, mode) {} - /** - * @brief Constructor that initialises the stream by starting a process. - * - * Initialises the stream buffer by calling - * @c do_open(argv[0],argv,mode) - * - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - explicit - basic_rpstream(const argv_type& argv, pmode mode = pstdout|pstdin) - : ostream_type(NULL), istream_type(NULL), - pbase_type(argv.at(0), argv, mode) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * Initialises the stream buffer by calling + * @c do_open(argv[0],argv,mode) + * + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + explicit basic_rpstream(const argv_type& argv, pmode mode = pstdout | pstdin) + : ostream_type(NULL), istream_type(NULL), pbase_type(argv.at(0), argv, mode) {} #if __cplusplus >= 201103L - /** - * @brief Constructor that initialises the stream by starting a process. - * - * @param l a list of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - template - explicit - basic_rpstream(std::initializer_list l, pmode mode = pstdout|pstdin) - : basic_rpstream(argv_type(l.begin(), l.end()), mode) - { } + /** + * @brief Constructor that initialises the stream by starting a process. + * + * @param l a list of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + template + explicit basic_rpstream(std::initializer_list l, pmode mode = pstdout | pstdin) + : basic_rpstream(argv_type(l.begin(), l.end()), mode) {} #endif - /// Destructor - ~basic_rpstream() { } + /// Destructor + ~basic_rpstream() {} - /** - * @brief Start a process. - * - * Calls do_open( @a cmd , @a mode ). - * - * @param cmd a string containing a shell command. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, pmode) - */ - void - open(const std::string& cmd, pmode mode = pstdout|pstdin) - { - this->do_open(cmd, mode); - } + /** + * @brief Start a process. + * + * Calls do_open( @a cmd , @a mode ). + * + * @param cmd a string containing a shell command. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, pmode) + */ + void open(const std::string& cmd, pmode mode = pstdout | pstdin) { this->do_open(cmd, mode); } - /** - * @brief Start a process. - * - * Calls do_open( @a file , @a argv , @a mode ). - * - * @param file a string containing the pathname of a program to execute. - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - void - open( const std::string& file, - const argv_type& argv, - pmode mode = pstdout|pstdin ) - { + /** + * @brief Start a process. + * + * Calls do_open( @a file , @a argv , @a mode ). + * + * @param file a string containing the pathname of a program to execute. + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ + void open(const std::string& file, const argv_type& argv, pmode mode = pstdout | pstdin) { this->do_open(file, argv, mode); - } + } - /** - * @brief Obtain a reference to the istream that reads - * the process' @c stdout. - * @return @c *this - */ - istream_type& - out() - { + /** + * @brief Obtain a reference to the istream that reads + * the process' @c stdout. + * @return @c *this + */ + istream_type& out() { this->buf_.read_err(false); return *this; - } + } - /** - * @brief Obtain a reference to the istream that reads - * the process' @c stderr. - * @return @c *this - */ - istream_type& - err() - { + /** + * @brief Obtain a reference to the istream that reads + * the process' @c stderr. + * @return @c *this + */ + istream_type& err() { this->buf_.read_err(true); return *this; - } - }; - - - /// Type definition for common template specialisation. - typedef basic_pstreambuf pstreambuf; - /// Type definition for common template specialisation. - typedef basic_ipstream ipstream; - /// Type definition for common template specialisation. - typedef basic_opstream opstream; - /// Type definition for common template specialisation. - typedef basic_pstream pstream; - /// Type definition for common template specialisation. - typedef basic_rpstream rpstream; - - - /** - * When inserted into an output pstream the manipulator calls - * basic_pstreambuf::peof() to close the output pipe, - * causing the child process to receive the end-of-file indicator - * on subsequent reads from its @c stdin stream. - * - * @brief Manipulator to close the pipe connected to the process' stdin. - * @param s An output PStream class. - * @return The stream object the manipulator was invoked on. - * @see basic_pstreambuf::peof() - * @relates basic_opstream basic_pstream basic_rpstream - */ - template - inline std::basic_ostream& - peof(std::basic_ostream& s) - { - typedef basic_pstreambuf pstreambuf_type; - if (pstreambuf_type* p = dynamic_cast(s.rdbuf())) - p->peof(); - return s; } +}; - /* - * member definitions for pstreambuf - */ +/// Type definition for common template specialisation. +typedef basic_pstreambuf pstreambuf; +/// Type definition for common template specialisation. +typedef basic_ipstream ipstream; +/// Type definition for common template specialisation. +typedef basic_opstream opstream; +/// Type definition for common template specialisation. +typedef basic_pstream pstream; +/// Type definition for common template specialisation. +typedef basic_rpstream rpstream; - /** - * @class basic_pstreambuf - * Provides underlying streambuf functionality for the PStreams classes. - */ +/** + * When inserted into an output pstream the manipulator calls + * basic_pstreambuf::peof() to close the output pipe, + * causing the child process to receive the end-of-file indicator + * on subsequent reads from its @c stdin stream. + * + * @brief Manipulator to close the pipe connected to the process' stdin. + * @param s An output PStream class. + * @return The stream object the manipulator was invoked on. + * @see basic_pstreambuf::peof() + * @relates basic_opstream basic_pstream basic_rpstream + */ +template +inline std::basic_ostream& peof(std::basic_ostream& s) { + typedef basic_pstreambuf pstreambuf_type; + if (pstreambuf_type* p = dynamic_cast(s.rdbuf())) p->peof(); + return s; +} - /** Creates an uninitialised stream buffer. */ - template - inline - basic_pstreambuf::basic_pstreambuf() - : ppid_(-1) // initialise to -1 to indicate no process run yet. - , wpipe_(-1) - , wbuffer_(NULL) - , rsrc_(rsrc_out) - , status_(-1) - , error_(0) - { - init_rbuffers(); - } - /** - * Initialises the stream buffer by calling open() with the supplied - * arguments. - * - * @param cmd a string containing a shell command. - * @param mode the I/O mode to use when opening the pipe. - * @see open() - */ - template - inline - basic_pstreambuf::basic_pstreambuf(const std::string& cmd, pmode mode) - : ppid_(-1) // initialise to -1 to indicate no process run yet. - , wpipe_(-1) - , wbuffer_(NULL) - , rsrc_(rsrc_out) - , status_(-1) - , error_(0) - { - init_rbuffers(); - open(cmd, mode); - } +/* + * member definitions for pstreambuf + */ - /** - * Initialises the stream buffer by calling open() with the supplied - * arguments. - * - * @param file a string containing the name of a program to execute. - * @param argv a vector of argument strings passsed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see open() - */ - template - inline - basic_pstreambuf::basic_pstreambuf( const std::string& file, - const argv_type& argv, - pmode mode ) - : ppid_(-1) // initialise to -1 to indicate no process run yet. - , wpipe_(-1) - , wbuffer_(NULL) - , rsrc_(rsrc_out) - , status_(-1) - , error_(0) - { - init_rbuffers(); - open(file, argv, mode); - } - /** - * Closes the stream by calling close(). - * @see close() - */ - template - inline - basic_pstreambuf::~basic_pstreambuf() - { - close(); - } +/** + * @class basic_pstreambuf + * Provides underlying streambuf functionality for the PStreams classes. + */ - /** - * Starts a new process by passing @a command to the shell (/bin/sh) - * and opens pipes to the process with the specified @a mode. - * - * If @a mode contains @c pstdout the initial read source will be - * the child process' stdout, otherwise if @a mode contains @c pstderr - * the initial read source will be the child's stderr. - * - * Will duplicate the actions of the shell in searching for an - * executable file if the specified file name does not contain a slash (/) - * character. - * - * @warning - * There is no way to tell whether the shell command succeeded, this - * function will always succeed unless resource limits (such as - * memory usage, or number of processes or open files) are exceeded. - * This means is_open() will return true even if @a command cannot - * be executed. - * Use pstreambuf::open(const std::string&, const argv_type&, pmode) - * if you need to know whether the command failed to execute. - * - * @param command a string containing a shell command. - * @param mode a bitwise OR of one or more of @c out, @c in, @c err. - * @return NULL if the shell could not be started or the - * pipes could not be opened, @c this otherwise. - * @see execl(3) - */ - template - basic_pstreambuf* - basic_pstreambuf::open(const std::string& command, pmode mode) - { - const char * shell_path = "/bin/sh"; +/** Creates an uninitialised stream buffer. */ +template +inline basic_pstreambuf::basic_pstreambuf() + : ppid_(-1) // initialise to -1 to indicate no process run yet. + , + wpipe_(-1), + wbuffer_(NULL), + rsrc_(rsrc_out), + status_(-1), + error_(0) { + init_rbuffers(); +} + +/** + * Initialises the stream buffer by calling open() with the supplied + * arguments. + * + * @param cmd a string containing a shell command. + * @param mode the I/O mode to use when opening the pipe. + * @see open() + */ +template +inline basic_pstreambuf::basic_pstreambuf(const std::string& cmd, pmode mode) + : ppid_(-1) // initialise to -1 to indicate no process run yet. + , + wpipe_(-1), + wbuffer_(NULL), + rsrc_(rsrc_out), + status_(-1), + error_(0) { + init_rbuffers(); + open(cmd, mode); +} + +/** + * Initialises the stream buffer by calling open() with the supplied + * arguments. + * + * @param file a string containing the name of a program to execute. + * @param argv a vector of argument strings passsed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see open() + */ +template +inline basic_pstreambuf::basic_pstreambuf(const std::string& file, const argv_type& argv, + pmode mode) + : ppid_(-1) // initialise to -1 to indicate no process run yet. + , + wpipe_(-1), + wbuffer_(NULL), + rsrc_(rsrc_out), + status_(-1), + error_(0) { + init_rbuffers(); + open(file, argv, mode); +} + +/** + * Closes the stream by calling close(). + * @see close() + */ +template +inline basic_pstreambuf::~basic_pstreambuf() { + close(); +} + +/** + * Starts a new process by passing @a command to the shell (/bin/sh) + * and opens pipes to the process with the specified @a mode. + * + * If @a mode contains @c pstdout the initial read source will be + * the child process' stdout, otherwise if @a mode contains @c pstderr + * the initial read source will be the child's stderr. + * + * Will duplicate the actions of the shell in searching for an + * executable file if the specified file name does not contain a slash (/) + * character. + * + * @warning + * There is no way to tell whether the shell command succeeded, this + * function will always succeed unless resource limits (such as + * memory usage, or number of processes or open files) are exceeded. + * This means is_open() will return true even if @a command cannot + * be executed. + * Use pstreambuf::open(const std::string&, const argv_type&, pmode) + * if you need to know whether the command failed to execute. + * + * @param command a string containing a shell command. + * @param mode a bitwise OR of one or more of @c out, @c in, @c err. + * @return NULL if the shell could not be started or the + * pipes could not be opened, @c this otherwise. + * @see execl(3) + */ +template +basic_pstreambuf* basic_pstreambuf::open(const std::string& command, pmode mode) { + const char* shell_path = "/bin/sh"; #if 0 const std::string argv[] = { "sh", "-c", command }; return this->open(shell_path, argv_type(argv, argv+3), mode); #else - basic_pstreambuf* ret = NULL; + basic_pstreambuf* ret = NULL; - if (!is_open()) - { - switch(fork(mode)) - { - case 0 : - // this is the new process, exec command - ::execl(shell_path, "sh", "-c", command.c_str(), (char*)NULL); + if (!is_open()) { + switch (fork(mode)) { + case 0: + // this is the new process, exec command + ::execl(shell_path, "sh", "-c", command.c_str(), (char*)NULL); - // can only reach this point if exec() failed + // can only reach this point if exec() failed - // parent can get exit code from waitpid() - ::_exit(errno); - // using std::exit() would make static dtors run twice + // parent can get exit code from waitpid() + ::_exit(errno); + // using std::exit() would make static dtors run twice - case -1 : - // couldn't fork, error already handled in pstreambuf::fork() - break; + case -1: + // couldn't fork, error already handled in pstreambuf::fork() + break; - default : - // this is the parent process - // activate buffers - create_buffers(mode); - ret = this; + default: + // this is the parent process + // activate buffers + create_buffers(mode); + ret = this; } - } - return ret; + } + return ret; #endif - } +} - /** - * @brief Helper function to close a file descriptor. - * - * Inspects @a fd and calls close(3) if it has a non-negative value. - * - * @param fd a file descriptor. - * @relates basic_pstreambuf - */ - inline void - close_fd(pstreams::fd_type& fd) - { - if (fd >= 0 && ::close(fd) == 0) - fd = -1; - } +/** + * @brief Helper function to close a file descriptor. + * + * Inspects @a fd and calls close(3) if it has a non-negative value. + * + * @param fd a file descriptor. + * @relates basic_pstreambuf + */ +inline void close_fd(pstreams::fd_type& fd) { + if (fd >= 0 && ::close(fd) == 0) fd = -1; +} - /** - * @brief Helper function to close an array of file descriptors. - * - * Calls @c close_fd() on each member of the array. - * The length of the array is determined automatically by - * template argument deduction to avoid errors. - * - * @param fds an array of file descriptors. - * @relates basic_pstreambuf - */ - template - inline void - close_fd_array(pstreams::fd_type (&fds)[N]) - { - for (std::size_t i = 0; i < N; ++i) - close_fd(fds[i]); - } +/** + * @brief Helper function to close an array of file descriptors. + * + * Calls @c close_fd() on each member of the array. + * The length of the array is determined automatically by + * template argument deduction to avoid errors. + * + * @param fds an array of file descriptors. + * @relates basic_pstreambuf + */ +template +inline void close_fd_array(pstreams::fd_type (&fds)[N]) { + for (std::size_t i = 0; i < N; ++i) close_fd(fds[i]); +} - /** - * Starts a new process by executing @a file with the arguments in - * @a argv and opens pipes to the process with the specified @a mode. - * - * By convention @c argv[0] should be the file name of the file being - * executed. - * - * If @a mode contains @c pstdout the initial read source will be - * the child process' stdout, otherwise if @a mode contains @c pstderr - * the initial read source will be the child's stderr. - * - * Will duplicate the actions of the shell in searching for an - * executable file if the specified file name does not contain a slash (/) - * character. - * - * Iff @a file is successfully executed then is_open() will return true. - * Otherwise, pstreambuf::error() can be used to obtain the value of - * @c errno that was set by execvp(3) in the child process. - * - * The exit status of the new process will be returned by - * pstreambuf::status() after pstreambuf::exited() returns true. - * - * @param file a string containing the pathname of a program to execute. - * @param argv a vector of argument strings passed to the new program. - * @param mode a bitwise OR of one or more of @c out, @c in and @c err. - * @return NULL if a pipe could not be opened or if the program could - * not be executed, @c this otherwise. - * @see execvp(3) - */ - template - basic_pstreambuf* - basic_pstreambuf::open( const std::string& file, - const argv_type& argv, - pmode mode ) - { - basic_pstreambuf* ret = NULL; +/** + * Starts a new process by executing @a file with the arguments in + * @a argv and opens pipes to the process with the specified @a mode. + * + * By convention @c argv[0] should be the file name of the file being + * executed. + * + * If @a mode contains @c pstdout the initial read source will be + * the child process' stdout, otherwise if @a mode contains @c pstderr + * the initial read source will be the child's stderr. + * + * Will duplicate the actions of the shell in searching for an + * executable file if the specified file name does not contain a slash (/) + * character. + * + * Iff @a file is successfully executed then is_open() will return true. + * Otherwise, pstreambuf::error() can be used to obtain the value of + * @c errno that was set by execvp(3) in the child process. + * + * The exit status of the new process will be returned by + * pstreambuf::status() after pstreambuf::exited() returns true. + * + * @param file a string containing the pathname of a program to execute. + * @param argv a vector of argument strings passed to the new program. + * @param mode a bitwise OR of one or more of @c out, @c in and @c err. + * @return NULL if a pipe could not be opened or if the program could + * not be executed, @c this otherwise. + * @see execvp(3) + */ +template +basic_pstreambuf* basic_pstreambuf::open(const std::string& file, const argv_type& argv, + pmode mode) { + basic_pstreambuf* ret = NULL; - if (!is_open()) - { + if (!is_open()) { // constants for read/write ends of pipe enum { RD, WR }; // open another pipe and set close-on-exec - fd_type ck_exec[] = { -1, -1 }; - if (-1 == ::pipe(ck_exec) - || -1 == ::fcntl(ck_exec[RD], F_SETFD, FD_CLOEXEC) - || -1 == ::fcntl(ck_exec[WR], F_SETFD, FD_CLOEXEC)) - { - error_ = errno; - close_fd_array(ck_exec); - } - else - { - switch(fork(mode)) - { - case 0 : - // this is the new process, exec command - { - char** arg_v = new char*[argv.size()+1]; - for (std::size_t i = 0; i < argv.size(); ++i) - { - const std::string& src = argv[i]; - char*& dest = arg_v[i]; - dest = new char[src.size()+1]; - dest[ src.copy(dest, src.size()) ] = '\0'; - } - arg_v[argv.size()] = NULL; - - ::execvp(file.c_str(), arg_v); - - // can only reach this point if exec() failed - - // parent can get error code from ck_exec pipe - error_ = errno; - - while (::write(ck_exec[WR], &error_, sizeof(error_)) == -1 - && errno == EINTR) - { } - - ::close(ck_exec[WR]); - ::close(ck_exec[RD]); - - ::_exit(error_); - // using std::exit() would make static dtors run twice - } - - case -1 : - // couldn't fork, error already handled in pstreambuf::fork() + fd_type ck_exec[] = {-1, -1}; + if (-1 == ::pipe(ck_exec) || -1 == ::fcntl(ck_exec[RD], F_SETFD, FD_CLOEXEC) || + -1 == ::fcntl(ck_exec[WR], F_SETFD, FD_CLOEXEC)) { + error_ = errno; close_fd_array(ck_exec); - break; + } else { + switch (fork(mode)) { + case 0: + // this is the new process, exec command + { + char** arg_v = new char*[argv.size() + 1]; + for (std::size_t i = 0; i < argv.size(); ++i) { + const std::string& src = argv[i]; + char*& dest = arg_v[i]; + dest = new char[src.size() + 1]; + dest[src.copy(dest, src.size())] = '\0'; + } + arg_v[argv.size()] = NULL; - default : - // this is the parent process + ::execvp(file.c_str(), arg_v); - // check child called exec() successfully - ::close(ck_exec[WR]); - switch (::read(ck_exec[RD], &error_, sizeof(error_))) - { - case 0: - // activate buffers - create_buffers(mode); - ret = this; - break; - case -1: - error_ = errno; - break; - default: - // error_ contains error code from child - // call wait() to clean up and set ppid_ to 0 - this->wait(); - break; + // can only reach this point if exec() failed + + // parent can get error code from ck_exec pipe + error_ = errno; + + while (::write(ck_exec[WR], &error_, sizeof(error_)) == -1 && + errno == EINTR) { + } + + ::close(ck_exec[WR]); + ::close(ck_exec[RD]); + + ::_exit(error_); + // using std::exit() would make static dtors run twice + } + + case -1: + // couldn't fork, error already handled in pstreambuf::fork() + close_fd_array(ck_exec); + break; + + default: + // this is the parent process + + // check child called exec() successfully + ::close(ck_exec[WR]); + switch (::read(ck_exec[RD], &error_, sizeof(error_))) { + case 0: + // activate buffers + create_buffers(mode); + ret = this; + break; + case -1: + error_ = errno; + break; + default: + // error_ contains error code from child + // call wait() to clean up and set ppid_ to 0 + this->wait(); + break; + } + ::close(ck_exec[RD]); } - ::close(ck_exec[RD]); - } } - } - return ret; } + return ret; +} - /** - * Creates pipes as specified by @a mode and calls @c fork() to create - * a new process. If the fork is successful the parent process stores - * the child's PID and the opened pipes and the child process replaces - * its standard streams with the opened pipes. - * - * If an error occurs the error code will be set to one of the possible - * errors for @c pipe() or @c fork(). - * See your system's documentation for these error codes. - * - * @param mode an OR of pmodes specifying which of the child's - * standard streams to connect to. - * @return On success the PID of the child is returned in the parent's - * context and zero is returned in the child's context. - * On error -1 is returned and the error code is set appropriately. - */ - template - pid_t - basic_pstreambuf::fork(pmode mode) - { - pid_t pid = -1; +/** + * Creates pipes as specified by @a mode and calls @c fork() to create + * a new process. If the fork is successful the parent process stores + * the child's PID and the opened pipes and the child process replaces + * its standard streams with the opened pipes. + * + * If an error occurs the error code will be set to one of the possible + * errors for @c pipe() or @c fork(). + * See your system's documentation for these error codes. + * + * @param mode an OR of pmodes specifying which of the child's + * standard streams to connect to. + * @return On success the PID of the child is returned in the parent's + * context and zero is returned in the child's context. + * On error -1 is returned and the error code is set appropriately. + */ +template +pid_t basic_pstreambuf::fork(pmode mode) { + pid_t pid = -1; - // Three pairs of file descriptors, for pipes connected to the - // process' stdin, stdout and stderr - // (stored in a single array so close_fd_array() can close all at once) - fd_type fd[] = { -1, -1, -1, -1, -1, -1 }; - fd_type* const pin = fd; - fd_type* const pout = fd+2; - fd_type* const perr = fd+4; + // Three pairs of file descriptors, for pipes connected to the + // process' stdin, stdout and stderr + // (stored in a single array so close_fd_array() can close all at once) + fd_type fd[] = {-1, -1, -1, -1, -1, -1}; + fd_type* const pin = fd; + fd_type* const pout = fd + 2; + fd_type* const perr = fd + 4; - // constants for read/write ends of pipe - enum { RD, WR }; + // constants for read/write ends of pipe + enum { RD, WR }; - // N.B. - // For the pstreambuf pin is an output stream and - // pout and perr are input streams. + // N.B. + // For the pstreambuf pin is an output stream and + // pout and perr are input streams. - if (!error_ && mode&pstdin && ::pipe(pin)) - error_ = errno; + if (!error_ && mode & pstdin && ::pipe(pin)) error_ = errno; - if (!error_ && mode&pstdout && ::pipe(pout)) - error_ = errno; + if (!error_ && mode & pstdout && ::pipe(pout)) error_ = errno; - if (!error_ && mode&pstderr && ::pipe(perr)) - error_ = errno; + if (!error_ && mode & pstderr && ::pipe(perr)) error_ = errno; - if (!error_) - { + if (!error_) { pid = ::fork(); - switch (pid) - { - case 0 : - { - // this is the new process + switch (pid) { + case 0: { + // this is the new process - // for each open pipe close one end and redirect the - // respective standard stream to the other end + // for each open pipe close one end and redirect the + // respective standard stream to the other end - if (*pin >= 0) - { - ::close(pin[WR]); - ::dup2(pin[RD], STDIN_FILENO); - ::close(pin[RD]); - } - if (*pout >= 0) - { - ::close(pout[RD]); - ::dup2(pout[WR], STDOUT_FILENO); - ::close(pout[WR]); - } - if (*perr >= 0) - { - ::close(perr[RD]); - ::dup2(perr[WR], STDERR_FILENO); - ::close(perr[WR]); - } + if (*pin >= 0) { + ::close(pin[WR]); + ::dup2(pin[RD], STDIN_FILENO); + ::close(pin[RD]); + } + if (*pout >= 0) { + ::close(pout[RD]); + ::dup2(pout[WR], STDOUT_FILENO); + ::close(pout[WR]); + } + if (*perr >= 0) { + ::close(perr[RD]); + ::dup2(perr[WR], STDERR_FILENO); + ::close(perr[WR]); + } #ifdef _POSIX_JOB_CONTROL - if (mode&newpg) - ::setpgid(0, 0); // Change to a new process group + if (mode & newpg) ::setpgid(0, 0); // Change to a new process group #endif - break; - } - case -1 : - { - // couldn't fork for some reason - error_ = errno; - // close any open pipes - close_fd_array(fd); - break; - } - default : - { - // this is the parent process, store process' pid - ppid_ = pid; + break; + } + case -1: { + // couldn't fork for some reason + error_ = errno; + // close any open pipes + close_fd_array(fd); + break; + } + default: { + // this is the parent process, store process' pid + ppid_ = pid; - // store one end of open pipes and close other end - if (*pin >= 0) - { - wpipe_ = pin[WR]; - ::close(pin[RD]); + // store one end of open pipes and close other end + if (*pin >= 0) { + wpipe_ = pin[WR]; + ::close(pin[RD]); + } + if (*pout >= 0) { + rpipe_[rsrc_out] = pout[RD]; + ::close(pout[WR]); + } + if (*perr >= 0) { + rpipe_[rsrc_err] = perr[RD]; + ::close(perr[WR]); + } } - if (*pout >= 0) - { - rpipe_[rsrc_out] = pout[RD]; - ::close(pout[WR]); - } - if (*perr >= 0) - { - rpipe_[rsrc_err] = perr[RD]; - ::close(perr[WR]); - } - } } - } - else - { + } else { // close any pipes we opened before failure close_fd_array(fd); - } - return pid; } + return pid; +} - /** - * Closes all pipes and calls wait() to wait for the process to finish. - * If an error occurs the error code will be set to one of the possible - * errors for @c waitpid(). - * See your system's documentation for these errors. - * - * @return @c this on successful close or @c NULL if there is no - * process to close or if an error occurs. - */ - template - basic_pstreambuf* - basic_pstreambuf::close() - { - const bool running = is_open(); +/** + * Closes all pipes and calls wait() to wait for the process to finish. + * If an error occurs the error code will be set to one of the possible + * errors for @c waitpid(). + * See your system's documentation for these errors. + * + * @return @c this on successful close or @c NULL if there is no + * process to close or if an error occurs. + */ +template +basic_pstreambuf* basic_pstreambuf::close() { + const bool running = is_open(); - sync(); // this might call wait() and reap the child process + sync(); // this might call wait() and reap the child process - // rather than trying to work out whether or not we need to clean up - // just do it anyway, all cleanup functions are safe to call twice. + // rather than trying to work out whether or not we need to clean up + // just do it anyway, all cleanup functions are safe to call twice. - destroy_buffers(pstdin|pstdout|pstderr); + destroy_buffers(pstdin | pstdout | pstderr); - // close pipes before wait() so child gets EOF/SIGPIPE - close_fd(wpipe_); - close_fd_array(rpipe_); + // close pipes before wait() so child gets EOF/SIGPIPE + close_fd(wpipe_); + close_fd_array(rpipe_); - do - { + do { error_ = 0; - } while (wait() == -1 && error() == EINTR); + } while (wait() == -1 && error() == EINTR); - return running ? this : NULL; - } + return running ? this : NULL; +} - /** - * Called on construction to initialise the arrays used for reading. - */ - template - inline void - basic_pstreambuf::init_rbuffers() - { - rpipe_[rsrc_out] = rpipe_[rsrc_err] = -1; - rbuffer_[rsrc_out] = rbuffer_[rsrc_err] = NULL; - rbufstate_[0] = rbufstate_[1] = rbufstate_[2] = NULL; - } +/** + * Called on construction to initialise the arrays used for reading. + */ +template +inline void basic_pstreambuf::init_rbuffers() { + rpipe_[rsrc_out] = rpipe_[rsrc_err] = -1; + rbuffer_[rsrc_out] = rbuffer_[rsrc_err] = NULL; + rbufstate_[0] = rbufstate_[1] = rbufstate_[2] = NULL; +} - template - void - basic_pstreambuf::create_buffers(pmode mode) - { - if (mode & pstdin) - { +template +void basic_pstreambuf::create_buffers(pmode mode) { + if (mode & pstdin) { delete[] wbuffer_; wbuffer_ = new char_type[bufsz]; this->setp(wbuffer_, wbuffer_ + bufsz); - } - if (mode & pstdout) - { + } + if (mode & pstdout) { delete[] rbuffer_[rsrc_out]; rbuffer_[rsrc_out] = new char_type[bufsz]; rsrc_ = rsrc_out; - this->setg(rbuffer_[rsrc_out] + pbsz, rbuffer_[rsrc_out] + pbsz, - rbuffer_[rsrc_out] + pbsz); - } - if (mode & pstderr) - { + this->setg(rbuffer_[rsrc_out] + pbsz, rbuffer_[rsrc_out] + pbsz, rbuffer_[rsrc_out] + pbsz); + } + if (mode & pstderr) { delete[] rbuffer_[rsrc_err]; rbuffer_[rsrc_err] = new char_type[bufsz]; - if (!(mode & pstdout)) - { - rsrc_ = rsrc_err; - this->setg(rbuffer_[rsrc_err] + pbsz, rbuffer_[rsrc_err] + pbsz, - rbuffer_[rsrc_err] + pbsz); + if (!(mode & pstdout)) { + rsrc_ = rsrc_err; + this->setg(rbuffer_[rsrc_err] + pbsz, rbuffer_[rsrc_err] + pbsz, + rbuffer_[rsrc_err] + pbsz); } - } } +} - template - void - basic_pstreambuf::destroy_buffers(pmode mode) - { - if (mode & pstdin) - { +template +void basic_pstreambuf::destroy_buffers(pmode mode) { + if (mode & pstdin) { this->setp(NULL, NULL); delete[] wbuffer_; wbuffer_ = NULL; - } - if (mode & pstdout) - { - if (rsrc_ == rsrc_out) - this->setg(NULL, NULL, NULL); + } + if (mode & pstdout) { + if (rsrc_ == rsrc_out) this->setg(NULL, NULL, NULL); delete[] rbuffer_[rsrc_out]; rbuffer_[rsrc_out] = NULL; - } - if (mode & pstderr) - { - if (rsrc_ == rsrc_err) - this->setg(NULL, NULL, NULL); + } + if (mode & pstderr) { + if (rsrc_ == rsrc_err) this->setg(NULL, NULL, NULL); delete[] rbuffer_[rsrc_err]; rbuffer_[rsrc_err] = NULL; - } } +} - template - typename basic_pstreambuf::buf_read_src - basic_pstreambuf::switch_read_buffer(buf_read_src src) - { - if (rsrc_ != src) - { +template +typename basic_pstreambuf::buf_read_src basic_pstreambuf::switch_read_buffer( + buf_read_src src) { + if (rsrc_ != src) { char_type* tmpbufstate[] = {this->eback(), this->gptr(), this->egptr()}; this->setg(rbufstate_[0], rbufstate_[1], rbufstate_[2]); - for (std::size_t i = 0; i < 3; ++i) - rbufstate_[i] = tmpbufstate[i]; + for (std::size_t i = 0; i < 3; ++i) rbufstate_[i] = tmpbufstate[i]; rsrc_ = src; - } - return rsrc_; } + return rsrc_; +} - /** - * Suspends execution and waits for the associated process to exit, or - * until a signal is delivered whose action is to terminate the current - * process or to call a signal handling function. If the process has - * already exited (i.e. it is a "zombie" process) then wait() returns - * immediately. Waiting for the child process causes all its system - * resources to be freed. - * - * error() will return EINTR if wait() is interrupted by a signal. - * - * @param nohang true to return immediately if the process has not exited. - * @return 1 if the process has exited and wait() has not yet been called. - * 0 if @a nohang is true and the process has not exited yet. - * -1 if no process has been started or if an error occurs, - * in which case the error can be found using error(). - */ - template - int - basic_pstreambuf::wait(bool nohang) - { - int child_exited = -1; - if (is_open()) - { +/** + * Suspends execution and waits for the associated process to exit, or + * until a signal is delivered whose action is to terminate the current + * process or to call a signal handling function. If the process has + * already exited (i.e. it is a "zombie" process) then wait() returns + * immediately. Waiting for the child process causes all its system + * resources to be freed. + * + * error() will return EINTR if wait() is interrupted by a signal. + * + * @param nohang true to return immediately if the process has not exited. + * @return 1 if the process has exited and wait() has not yet been called. + * 0 if @a nohang is true and the process has not exited yet. + * -1 if no process has been started or if an error occurs, + * in which case the error can be found using error(). + */ +template +int basic_pstreambuf::wait(bool nohang) { + int child_exited = -1; + if (is_open()) { int exit_status; - switch(::waitpid(ppid_, &exit_status, nohang ? WNOHANG : 0)) - { - case 0 : - // nohang was true and process has not exited - child_exited = 0; - break; - case -1 : - error_ = errno; - break; - default : - // process has exited - ppid_ = 0; - status_ = exit_status; - child_exited = 1; - // Close wpipe, would get SIGPIPE if we used it. - destroy_buffers(pstdin); - close_fd(wpipe_); - // Must free read buffers and pipes on destruction - // or next call to open()/close() - break; + switch (::waitpid(ppid_, &exit_status, nohang ? WNOHANG : 0)) { + case 0: + // nohang was true and process has not exited + child_exited = 0; + break; + case -1: + error_ = errno; + break; + default: + // process has exited + ppid_ = 0; + status_ = exit_status; + child_exited = 1; + // Close wpipe, would get SIGPIPE if we used it. + destroy_buffers(pstdin); + close_fd(wpipe_); + // Must free read buffers and pipes on destruction + // or next call to open()/close() + break; } - } - return child_exited; } + return child_exited; +} - /** - * Sends the specified signal to the process. A signal can be used to - * terminate a child process that would not exit otherwise. - * - * If an error occurs the error code will be set to one of the possible - * errors for @c kill(). See your system's documentation for these errors. - * - * @param signal A signal to send to the child process. - * @return @c this or @c NULL if @c kill() fails. - */ - template - inline basic_pstreambuf* - basic_pstreambuf::kill(int signal) - { - basic_pstreambuf* ret = NULL; - if (is_open()) - { +/** + * Sends the specified signal to the process. A signal can be used to + * terminate a child process that would not exit otherwise. + * + * If an error occurs the error code will be set to one of the possible + * errors for @c kill(). See your system's documentation for these errors. + * + * @param signal A signal to send to the child process. + * @return @c this or @c NULL if @c kill() fails. + */ +template +inline basic_pstreambuf* basic_pstreambuf::kill(int signal) { + basic_pstreambuf* ret = NULL; + if (is_open()) { if (::kill(ppid_, signal)) - error_ = errno; - else - { + error_ = errno; + else { #if 0 // TODO call exited() to check for exit and clean up? leave to user? if (signal==SIGTERM || signal==SIGKILL) this->exited(); #endif - ret = this; + ret = this; } - } - return ret; } + return ret; +} - /** - * Sends the specified signal to the process group of the child process. - * A signal can be used to terminate a child process that would not exit - * otherwise, or to kill the process and its own children. - * - * If an error occurs the error code will be set to one of the possible - * errors for @c getpgid() or @c kill(). See your system's documentation - * for these errors. If the child is in the current process group then - * NULL will be returned and the error code set to EPERM. - * - * @param signal A signal to send to the child process. - * @return @c this on success or @c NULL on failure. - */ - template - inline basic_pstreambuf* - basic_pstreambuf::killpg(int signal) - { - basic_pstreambuf* ret = NULL; +/** + * Sends the specified signal to the process group of the child process. + * A signal can be used to terminate a child process that would not exit + * otherwise, or to kill the process and its own children. + * + * If an error occurs the error code will be set to one of the possible + * errors for @c getpgid() or @c kill(). See your system's documentation + * for these errors. If the child is in the current process group then + * NULL will be returned and the error code set to EPERM. + * + * @param signal A signal to send to the child process. + * @return @c this on success or @c NULL on failure. + */ +template +inline basic_pstreambuf* basic_pstreambuf::killpg(int signal) { + basic_pstreambuf* ret = NULL; #ifdef _POSIX_JOB_CONTROL - if (is_open()) - { + if (is_open()) { pid_t pgid = ::getpgid(ppid_); if (pgid == -1) - error_ = errno; + error_ = errno; else if (pgid == ::getpgrp()) - error_ = EPERM; // Don't commit suicide + error_ = EPERM; // Don't commit suicide else if (::killpg(pgid, signal)) - error_ = errno; + error_ = errno; else - ret = this; - } + ret = this; + } #else - error_ = ENOTSUP; + error_ = ENOTSUP; #endif - return ret; - } + return ret; +} - /** - * This function can call pstreambuf::wait() and so may change the - * object's state if the child process has already exited. - * - * @return True if the associated process has exited, false otherwise. - * @see basic_pstreambuf::wait() - */ - template - inline bool - basic_pstreambuf::exited() - { - return ppid_ == 0 || wait(true)==1; - } +/** + * This function can call pstreambuf::wait() and so may change the + * object's state if the child process has already exited. + * + * @return True if the associated process has exited, false otherwise. + * @see basic_pstreambuf::wait() + */ +template +inline bool basic_pstreambuf::exited() { + return ppid_ == 0 || wait(true) == 1; +} - /** - * @return The exit status of the child process, or -1 if wait() - * has not yet been called to wait for the child to exit. - * @see basic_pstreambuf::wait() - */ - template - inline int - basic_pstreambuf::status() const - { - return status_; - } +/** + * @return The exit status of the child process, or -1 if wait() + * has not yet been called to wait for the child to exit. + * @see basic_pstreambuf::wait() + */ +template +inline int basic_pstreambuf::status() const { + return status_; +} - /** - * @return The error code of the most recently failed operation, or zero. - */ - template - inline int - basic_pstreambuf::error() const - { - return error_; - } +/** + * @return The error code of the most recently failed operation, or zero. + */ +template +inline int basic_pstreambuf::error() const { + return error_; +} - /** - * Closes the output pipe, causing the child process to receive the - * end-of-file indicator on subsequent reads from its @c stdin stream. - */ - template - inline void - basic_pstreambuf::peof() - { - sync(); - destroy_buffers(pstdin); - close_fd(wpipe_); - } +/** + * Closes the output pipe, causing the child process to receive the + * end-of-file indicator on subsequent reads from its @c stdin stream. + */ +template +inline void basic_pstreambuf::peof() { + sync(); + destroy_buffers(pstdin); + close_fd(wpipe_); +} - /** - * Unlike pstreambuf::exited(), this function will not call wait() and - * so will not change the object's state. This means that once a child - * process is executed successfully this function will continue to - * return true even after the process exits (until wait() is called.) - * - * @return true if a previous call to open() succeeded and wait() has - * not been called and determined that the process has exited, - * false otherwise. - */ - template - inline bool - basic_pstreambuf::is_open() const - { - return ppid_ > 0; - } +/** + * Unlike pstreambuf::exited(), this function will not call wait() and + * so will not change the object's state. This means that once a child + * process is executed successfully this function will continue to + * return true even after the process exits (until wait() is called.) + * + * @return true if a previous call to open() succeeded and wait() has + * not been called and determined that the process has exited, + * false otherwise. + */ +template +inline bool basic_pstreambuf::is_open() const { + return ppid_ > 0; +} - /** - * Toggle the stream used for reading. If @a readerr is @c true then the - * process' @c stderr output will be used for subsequent extractions, if - * @a readerr is false the the process' stdout will be used. - * @param readerr @c true to read @c stderr, @c false to read @c stdout. - * @return @c true if the requested stream is open and will be used for - * subsequent extractions, @c false otherwise. - */ - template - inline bool - basic_pstreambuf::read_err(bool readerr) - { - buf_read_src src = readerr ? rsrc_err : rsrc_out; - if (rpipe_[src]>=0) - { +/** + * Toggle the stream used for reading. If @a readerr is @c true then the + * process' @c stderr output will be used for subsequent extractions, if + * @a readerr is false the the process' stdout will be used. + * @param readerr @c true to read @c stderr, @c false to read @c stdout. + * @return @c true if the requested stream is open and will be used for + * subsequent extractions, @c false otherwise. + */ +template +inline bool basic_pstreambuf::read_err(bool readerr) { + buf_read_src src = readerr ? rsrc_err : rsrc_out; + if (rpipe_[src] >= 0) { switch_read_buffer(src); return true; - } - return false; } + return false; +} - /** - * Called when the internal character buffer is not present or is full, - * to transfer the buffer contents to the pipe. - * - * @param c a character to be written to the pipe. - * @return @c traits_type::eof() if an error occurs, otherwise if @a c - * is not equal to @c traits_type::eof() it will be buffered and - * a value other than @c traits_type::eof() returned to indicate - * success. - */ - template - typename basic_pstreambuf::int_type - basic_pstreambuf::overflow(int_type c) - { - if (!empty_buffer()) +/** + * Called when the internal character buffer is not present or is full, + * to transfer the buffer contents to the pipe. + * + * @param c a character to be written to the pipe. + * @return @c traits_type::eof() if an error occurs, otherwise if @a c + * is not equal to @c traits_type::eof() it will be buffered and + * a value other than @c traits_type::eof() returned to indicate + * success. + */ +template +typename basic_pstreambuf::int_type basic_pstreambuf::overflow(int_type c) { + if (!empty_buffer()) return traits_type::eof(); - else if (!traits_type::eq_int_type(c, traits_type::eof())) + else if (!traits_type::eq_int_type(c, traits_type::eof())) return this->sputc(c); - else + else return traits_type::not_eof(c); +} + + +template +int basic_pstreambuf::sync() { + return !exited() && empty_buffer() ? 0 : -1; +} + +/** + * @param s character buffer. + * @param n buffer length. + * @return the number of characters written. + */ +template +std::streamsize basic_pstreambuf::xsputn(const char_type* s, std::streamsize n) { + std::streamsize done = 0; + while (done < n) { + if (std::streamsize nbuf = this->epptr() - this->pptr()) { + nbuf = std::min(nbuf, n - done); + traits_type::copy(this->pptr(), s + done, nbuf); + this->pbump(nbuf); + done += nbuf; + } else if (!empty_buffer()) + break; } + return done; +} - - template - int - basic_pstreambuf::sync() - { - return !exited() && empty_buffer() ? 0 : -1; - } - - /** - * @param s character buffer. - * @param n buffer length. - * @return the number of characters written. - */ - template - std::streamsize - basic_pstreambuf::xsputn(const char_type* s, std::streamsize n) - { - std::streamsize done = 0; - while (done < n) - { - if (std::streamsize nbuf = this->epptr() - this->pptr()) - { - nbuf = std::min(nbuf, n - done); - traits_type::copy(this->pptr(), s + done, nbuf); - this->pbump(nbuf); - done += nbuf; - } - else if (!empty_buffer()) - break; - } - return done; - } - - /** - * @return true if the buffer was emptied, false otherwise. - */ - template - bool - basic_pstreambuf::empty_buffer() - { - const std::streamsize count = this->pptr() - this->pbase(); - if (count > 0) - { +/** + * @return true if the buffer was emptied, false otherwise. + */ +template +bool basic_pstreambuf::empty_buffer() { + const std::streamsize count = this->pptr() - this->pbase(); + if (count > 0) { const std::streamsize written = this->write(this->wbuffer_, count); - if (written > 0) - { - if (const std::streamsize unwritten = count - written) - traits_type::move(this->pbase(), this->pbase()+written, unwritten); - this->pbump(-written); - return true; + if (written > 0) { + if (const std::streamsize unwritten = count - written) + traits_type::move(this->pbase(), this->pbase() + written, unwritten); + this->pbump(-written); + return true; } - } - return false; } + return false; +} - /** - * Called when the internal character buffer is is empty, to re-fill it - * from the pipe. - * - * @return The first available character in the buffer, - * or @c traits_type::eof() in case of failure. - */ - template - typename basic_pstreambuf::int_type - basic_pstreambuf::underflow() - { - if (this->gptr() < this->egptr() || fill_buffer()) +/** + * Called when the internal character buffer is is empty, to re-fill it + * from the pipe. + * + * @return The first available character in the buffer, + * or @c traits_type::eof() in case of failure. + */ +template +typename basic_pstreambuf::int_type basic_pstreambuf::underflow() { + if (this->gptr() < this->egptr() || fill_buffer()) return traits_type::to_int_type(*this->gptr()); - else + else return traits_type::eof(); - } +} - /** - * Attempts to make @a c available as the next character to be read by - * @c sgetc(). - * - * @param c a character to make available for extraction. - * @return @a c if the character can be made available, - * @c traits_type::eof() otherwise. - */ - template - typename basic_pstreambuf::int_type - basic_pstreambuf::pbackfail(int_type c) - { - if (this->gptr() != this->eback()) - { +/** + * Attempts to make @a c available as the next character to be read by + * @c sgetc(). + * + * @param c a character to make available for extraction. + * @return @a c if the character can be made available, + * @c traits_type::eof() otherwise. + */ +template +typename basic_pstreambuf::int_type basic_pstreambuf::pbackfail(int_type c) { + if (this->gptr() != this->eback()) { this->gbump(-1); if (!traits_type::eq_int_type(c, traits_type::eof())) - *this->gptr() = traits_type::to_char_type(c); + *this->gptr() = traits_type::to_char_type(c); return traits_type::not_eof(c); - } - else - return traits_type::eof(); - } + } else + return traits_type::eof(); +} - template - std::streamsize - basic_pstreambuf::showmanyc() - { - int avail = 0; - if (sizeof(char_type) == 1) - avail = fill_buffer(true) ? this->egptr() - this->gptr() : -1; +template +std::streamsize basic_pstreambuf::showmanyc() { + int avail = 0; + if (sizeof(char_type) == 1) avail = fill_buffer(true) ? this->egptr() - this->gptr() : -1; #ifdef FIONREAD - else - { + else { if (::ioctl(rpipe(), FIONREAD, &avail) == -1) - avail = -1; + avail = -1; else if (avail) - avail /= sizeof(char_type); - } -#endif - return std::streamsize(avail); + avail /= sizeof(char_type); } +#endif + return std::streamsize(avail); +} - /** - * @return true if the buffer was filled, false otherwise. - */ - template - bool - basic_pstreambuf::fill_buffer(bool non_blocking) - { - const std::streamsize pb1 = this->gptr() - this->eback(); - const std::streamsize pb2 = pbsz; - const std::streamsize npb = std::min(pb1, pb2); +/** + * @return true if the buffer was filled, false otherwise. + */ +template +bool basic_pstreambuf::fill_buffer(bool non_blocking) { + const std::streamsize pb1 = this->gptr() - this->eback(); + const std::streamsize pb2 = pbsz; + const std::streamsize npb = std::min(pb1, pb2); - char_type* const rbuf = rbuffer(); + char_type* const rbuf = rbuffer(); - if (npb) - traits_type::move(rbuf + pbsz - npb, this->gptr() - npb, npb); + if (npb) traits_type::move(rbuf + pbsz - npb, this->gptr() - npb, npb); - std::streamsize rc = -1; + std::streamsize rc = -1; - if (non_blocking) - { + if (non_blocking) { const int flags = ::fcntl(rpipe(), F_GETFL); - if (flags != -1) - { - const bool blocking = !(flags & O_NONBLOCK); - if (blocking) - ::fcntl(rpipe(), F_SETFL, flags | O_NONBLOCK); // set non-blocking + if (flags != -1) { + const bool blocking = !(flags & O_NONBLOCK); + if (blocking) ::fcntl(rpipe(), F_SETFL, flags | O_NONBLOCK); // set non-blocking - error_ = 0; - rc = read(rbuf + pbsz, bufsz - pbsz); + error_ = 0; + rc = read(rbuf + pbsz, bufsz - pbsz); - if (rc == -1 && error_ == EAGAIN) // nothing available - rc = 0; - else if (rc == 0) // EOF - rc = -1; + if (rc == -1 && error_ == EAGAIN) // nothing available + rc = 0; + else if (rc == 0) // EOF + rc = -1; - if (blocking) - ::fcntl(rpipe(), F_SETFL, flags); // restore + if (blocking) ::fcntl(rpipe(), F_SETFL, flags); // restore } - } - else + } else rc = read(rbuf + pbsz, bufsz - pbsz); - if (rc > 0 || (rc == 0 && non_blocking)) - { - this->setg( rbuf + pbsz - npb, - rbuf + pbsz, - rbuf + pbsz + rc ); + if (rc > 0 || (rc == 0 && non_blocking)) { + this->setg(rbuf + pbsz - npb, rbuf + pbsz, rbuf + pbsz + rc); return true; - } - else - { + } else { this->setg(NULL, NULL, NULL); return false; - } } +} - /** - * Writes up to @a n characters to the pipe from the buffer @a s. - * - * @param s character buffer. - * @param n buffer length. - * @return the number of characters written. - */ - template - inline std::streamsize - basic_pstreambuf::write(const char_type* s, std::streamsize n) - { - std::streamsize nwritten = 0; - if (wpipe() >= 0) - { +/** + * Writes up to @a n characters to the pipe from the buffer @a s. + * + * @param s character buffer. + * @param n buffer length. + * @return the number of characters written. + */ +template +inline std::streamsize basic_pstreambuf::write(const char_type* s, std::streamsize n) { + std::streamsize nwritten = 0; + if (wpipe() >= 0) { nwritten = ::write(wpipe(), s, n * sizeof(char_type)); if (nwritten == -1) - error_ = errno; + error_ = errno; else - nwritten /= sizeof(char_type); - } - return nwritten; + nwritten /= sizeof(char_type); } + return nwritten; +} - /** - * Reads up to @a n characters from the pipe to the buffer @a s. - * - * @param s character buffer. - * @param n buffer length. - * @return the number of characters read. - */ - template - inline std::streamsize - basic_pstreambuf::read(char_type* s, std::streamsize n) - { - std::streamsize nread = 0; - if (rpipe() >= 0) - { +/** + * Reads up to @a n characters from the pipe to the buffer @a s. + * + * @param s character buffer. + * @param n buffer length. + * @return the number of characters read. + */ +template +inline std::streamsize basic_pstreambuf::read(char_type* s, std::streamsize n) { + std::streamsize nread = 0; + if (rpipe() >= 0) { nread = ::read(rpipe(), s, n * sizeof(char_type)); if (nread == -1) - error_ = errno; + error_ = errno; else - nread /= sizeof(char_type); - } - return nread; + nread /= sizeof(char_type); } + return nread; +} - /** @return a reference to the output file descriptor */ - template - inline pstreams::fd_type& - basic_pstreambuf::wpipe() - { - return wpipe_; - } +/** @return a reference to the output file descriptor */ +template +inline pstreams::fd_type& basic_pstreambuf::wpipe() { + return wpipe_; +} - /** @return a reference to the active input file descriptor */ - template - inline pstreams::fd_type& - basic_pstreambuf::rpipe() - { - return rpipe_[rsrc_]; - } +/** @return a reference to the active input file descriptor */ +template +inline pstreams::fd_type& basic_pstreambuf::rpipe() { + return rpipe_[rsrc_]; +} - /** @return a reference to the specified input file descriptor */ - template - inline pstreams::fd_type& - basic_pstreambuf::rpipe(buf_read_src which) - { - return rpipe_[which]; - } +/** @return a reference to the specified input file descriptor */ +template +inline pstreams::fd_type& basic_pstreambuf::rpipe(buf_read_src which) { + return rpipe_[which]; +} - /** @return a pointer to the start of the active input buffer area. */ - template - inline typename basic_pstreambuf::char_type* - basic_pstreambuf::rbuffer() - { - return rbuffer_[rsrc_]; - } +/** @return a pointer to the start of the active input buffer area. */ +template +inline typename basic_pstreambuf::char_type* basic_pstreambuf::rbuffer() { + return rbuffer_[rsrc_]; +} - /* - * member definitions for pstream_common - */ +/* + * member definitions for pstream_common + */ - /** - * @class pstream_common - * Abstract Base Class providing common functionality for basic_ipstream, - * basic_opstream and basic_pstream. - * pstream_common manages the basic_pstreambuf stream buffer that is used - * by the derived classes to initialise an iostream class. - */ +/** + * @class pstream_common + * Abstract Base Class providing common functionality for basic_ipstream, + * basic_opstream and basic_pstream. + * pstream_common manages the basic_pstreambuf stream buffer that is used + * by the derived classes to initialise an iostream class. + */ - /** Creates an uninitialised stream. */ - template - inline - pstream_common::pstream_common() - : std::basic_ios(NULL) - , command_() - , buf_() - { - this->std::basic_ios::rdbuf(&buf_); - } +/** Creates an uninitialised stream. */ +template +inline pstream_common::pstream_common() : std::basic_ios(NULL), command_(), buf_() { + this->std::basic_ios::rdbuf(&buf_); +} - /** - * Initialises the stream buffer by calling - * do_open( @a command , @a mode ) - * - * @param cmd a string containing a shell command. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, pmode) - */ - template - inline - pstream_common::pstream_common(const std::string& cmd, pmode mode) - : std::basic_ios(NULL) - , command_(cmd) - , buf_() - { - this->std::basic_ios::rdbuf(&buf_); - do_open(cmd, mode); - } +/** + * Initialises the stream buffer by calling + * do_open( @a command , @a mode ) + * + * @param cmd a string containing a shell command. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, pmode) + */ +template +inline pstream_common::pstream_common(const std::string& cmd, pmode mode) + : std::basic_ios(NULL), command_(cmd), buf_() { + this->std::basic_ios::rdbuf(&buf_); + do_open(cmd, mode); +} - /** - * Initialises the stream buffer by calling - * do_open( @a file , @a argv , @a mode ) - * - * @param file a string containing the pathname of a program to execute. - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see do_open(const std::string&, const argv_type&, pmode) - */ - template - inline - pstream_common::pstream_common( const std::string& file, - const argv_type& argv, - pmode mode ) - : std::basic_ios(NULL) - , command_(file) - , buf_() - { - this->std::basic_ios::rdbuf(&buf_); - do_open(file, argv, mode); - } +/** + * Initialises the stream buffer by calling + * do_open( @a file , @a argv , @a mode ) + * + * @param file a string containing the pathname of a program to execute. + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see do_open(const std::string&, const argv_type&, pmode) + */ +template +inline pstream_common::pstream_common(const std::string& file, const argv_type& argv, + pmode mode) + : std::basic_ios(NULL), command_(file), buf_() { + this->std::basic_ios::rdbuf(&buf_); + do_open(file, argv, mode); +} - /** - * This is a pure virtual function to make @c pstream_common abstract. - * Because it is the destructor it will be called by derived classes - * and so must be defined. It is also protected, to discourage use of - * the PStreams classes through pointers or references to the base class. - * - * @sa If defining a pure virtual seems odd you should read - * http://www.gotw.ca/gotw/031.htm (and the rest of the site as well!) - */ - template - inline - pstream_common::~pstream_common() - { - } +/** + * This is a pure virtual function to make @c pstream_common abstract. + * Because it is the destructor it will be called by derived classes + * and so must be defined. It is also protected, to discourage use of + * the PStreams classes through pointers or references to the base class. + * + * @sa If defining a pure virtual seems odd you should read + * http://www.gotw.ca/gotw/031.htm (and the rest of the site as well!) + */ +template +inline pstream_common::~pstream_common() {} - /** - * Calls rdbuf()->open( @a command , @a mode ) - * and sets @c failbit on error. - * - * @param cmd a string containing a shell command. - * @param mode the I/O mode to use when opening the pipe. - * @see basic_pstreambuf::open(const std::string&, pmode) - */ - template - inline void - pstream_common::do_open(const std::string& cmd, pmode mode) - { - if (!buf_.open((command_=cmd), mode)) - this->setstate(std::ios_base::failbit); - } +/** + * Calls rdbuf()->open( @a command , @a mode ) + * and sets @c failbit on error. + * + * @param cmd a string containing a shell command. + * @param mode the I/O mode to use when opening the pipe. + * @see basic_pstreambuf::open(const std::string&, pmode) + */ +template +inline void pstream_common::do_open(const std::string& cmd, pmode mode) { + if (!buf_.open((command_ = cmd), mode)) this->setstate(std::ios_base::failbit); +} - /** - * Calls rdbuf()->open( @a file, @a argv, @a mode ) - * and sets @c failbit on error. - * - * @param file a string containing the pathname of a program to execute. - * @param argv a vector of argument strings passed to the new program. - * @param mode the I/O mode to use when opening the pipe. - * @see basic_pstreambuf::open(const std::string&, const argv_type&, pmode) - */ - template - inline void - pstream_common::do_open( const std::string& file, - const argv_type& argv, - pmode mode ) - { - if (!buf_.open((command_=file), argv, mode)) - this->setstate(std::ios_base::failbit); - } +/** + * Calls rdbuf()->open( @a file, @a argv, @a mode ) + * and sets @c failbit on error. + * + * @param file a string containing the pathname of a program to execute. + * @param argv a vector of argument strings passed to the new program. + * @param mode the I/O mode to use when opening the pipe. + * @see basic_pstreambuf::open(const std::string&, const argv_type&, pmode) + */ +template +inline void pstream_common::do_open(const std::string& file, const argv_type& argv, + pmode mode) { + if (!buf_.open((command_ = file), argv, mode)) this->setstate(std::ios_base::failbit); +} - /** Calls rdbuf->close() and sets @c failbit on error. */ - template - inline void - pstream_common::close() - { - if (!buf_.close()) - this->setstate(std::ios_base::failbit); - } +/** Calls rdbuf->close() and sets @c failbit on error. */ +template +inline void pstream_common::close() { + if (!buf_.close()) this->setstate(std::ios_base::failbit); +} - /** - * @return rdbuf()->is_open(). - * @see basic_pstreambuf::is_open() - */ - template - inline bool - pstream_common::is_open() const - { - return buf_.is_open(); - } +/** + * @return rdbuf()->is_open(). + * @see basic_pstreambuf::is_open() + */ +template +inline bool pstream_common::is_open() const { + return buf_.is_open(); +} - /** @return a string containing the command used to initialise the stream. */ - template - inline const std::string& - pstream_common::command() const - { - return command_; - } +/** @return a string containing the command used to initialise the stream. */ +template +inline const std::string& pstream_common::command() const { + return command_; +} - /** @return a pointer to the private stream buffer member. */ - // TODO document behaviour if buffer replaced. - template - inline typename pstream_common::streambuf_type* - pstream_common::rdbuf() const - { - return const_cast(&buf_); - } +/** @return a pointer to the private stream buffer member. */ +// TODO document behaviour if buffer replaced. +template +inline typename pstream_common::streambuf_type* pstream_common::rdbuf() const { + return const_cast(&buf_); +} #if REDI_EVISCERATE_PSTREAMS - /** - * @def REDI_EVISCERATE_PSTREAMS - * If this macro has a non-zero value then certain internals of the - * @c basic_pstreambuf template class are exposed. In general this is - * a Bad Thing, as the internal implementation is largely undocumented - * and may be subject to change at any time, so this feature is only - * provided because it might make PStreams useful in situations where - * it is necessary to do Bad Things. - */ +/** + * @def REDI_EVISCERATE_PSTREAMS + * If this macro has a non-zero value then certain internals of the + * @c basic_pstreambuf template class are exposed. In general this is + * a Bad Thing, as the internal implementation is largely undocumented + * and may be subject to change at any time, so this feature is only + * provided because it might make PStreams useful in situations where + * it is necessary to do Bad Things. + */ - /** - * @warning This function exposes the internals of the stream buffer and - * should be used with caution. It is the caller's responsibility - * to flush streams etc. in order to clear any buffered data. - * The POSIX.1 function fdopen(3) is used to obtain the - * @c FILE pointers from the streambuf's private file descriptor - * members so consult your system's documentation for - * fdopen(3). - * - * @param in A FILE* that will refer to the process' stdin. - * @param out A FILE* that will refer to the process' stdout. - * @param err A FILE* that will refer to the process' stderr. - * @return An OR of zero or more of @c pstdin, @c pstdout, @c pstderr. - * - * For each open stream shared with the child process a @c FILE* is - * obtained and assigned to the corresponding parameter. For closed - * streams @c NULL is assigned to the parameter. - * The return value can be tested to see which parameters should be - * @c !NULL by masking with the corresponding @c pmode value. - * - * @see fdopen(3) - */ - template - std::size_t - basic_pstreambuf::fopen(FILE*& in, FILE*& out, FILE*& err) - { - in = out = err = NULL; - std::size_t open_files = 0; - if (wpipe() > -1) - { - if ((in = ::fdopen(wpipe(), "w"))) - { +/** + * @warning This function exposes the internals of the stream buffer and + * should be used with caution. It is the caller's responsibility + * to flush streams etc. in order to clear any buffered data. + * The POSIX.1 function fdopen(3) is used to obtain the + * @c FILE pointers from the streambuf's private file descriptor + * members so consult your system's documentation for + * fdopen(3). + * + * @param in A FILE* that will refer to the process' stdin. + * @param out A FILE* that will refer to the process' stdout. + * @param err A FILE* that will refer to the process' stderr. + * @return An OR of zero or more of @c pstdin, @c pstdout, @c pstderr. + * + * For each open stream shared with the child process a @c FILE* is + * obtained and assigned to the corresponding parameter. For closed + * streams @c NULL is assigned to the parameter. + * The return value can be tested to see which parameters should be + * @c !NULL by masking with the corresponding @c pmode value. + * + * @see fdopen(3) + */ +template +std::size_t basic_pstreambuf::fopen(FILE*& in, FILE*& out, FILE*& err) { + in = out = err = NULL; + std::size_t open_files = 0; + if (wpipe() > -1) { + if ((in = ::fdopen(wpipe(), "w"))) { open_files |= pstdin; } - } - if (rpipe(rsrc_out) > -1) - { - if ((out = ::fdopen(rpipe(rsrc_out), "r"))) - { + } + if (rpipe(rsrc_out) > -1) { + if ((out = ::fdopen(rpipe(rsrc_out), "r"))) { open_files |= pstdout; } - } - if (rpipe(rsrc_err) > -1) - { - if ((err = ::fdopen(rpipe(rsrc_err), "r"))) - { + } + if (rpipe(rsrc_err) > -1) { + if ((err = ::fdopen(rpipe(rsrc_err), "r"))) { open_files |= pstderr; } - } - return open_files; } + return open_files; +} - /** - * @warning This function exposes the internals of the stream buffer and - * should be used with caution. - * - * @param in A FILE* that will refer to the process' stdin. - * @param out A FILE* that will refer to the process' stdout. - * @param err A FILE* that will refer to the process' stderr. - * @return A bitwise-or of zero or more of @c pstdin, @c pstdout, @c pstderr. - * @see basic_pstreambuf::fopen() - */ - template - inline std::size_t - pstream_common::fopen(FILE*& fin, FILE*& fout, FILE*& ferr) - { - return buf_.fopen(fin, fout, ferr); - } +/** + * @warning This function exposes the internals of the stream buffer and + * should be used with caution. + * + * @param in A FILE* that will refer to the process' stdin. + * @param out A FILE* that will refer to the process' stdout. + * @param err A FILE* that will refer to the process' stderr. + * @return A bitwise-or of zero or more of @c pstdin, @c pstdout, @c pstderr. + * @see basic_pstreambuf::fopen() + */ +template +inline std::size_t pstream_common::fopen(FILE*& fin, FILE*& fout, FILE*& ferr) { + return buf_.fopen(fin, fout, ferr); +} -#endif // REDI_EVISCERATE_PSTREAMS +#endif // REDI_EVISCERATE_PSTREAMS -} // namespace redi +} // namespace redi /** * @mainpage PStreams Reference @@ -2252,4 +1914,3 @@ namespace redi #endif // REDI_PSTREAM_H_SEEN // vim: ts=2 sw=2 expandtab - diff --git a/hipamd/samples/0_Intro/bit_extract/bit_extract.cpp b/hipamd/samples/0_Intro/bit_extract/bit_extract.cpp index a30f2d052d..be7c5b020f 100644 --- a/hipamd/samples/0_Intro/bit_extract/bit_extract.cpp +++ b/hipamd/samples/0_Intro/bit_extract/bit_extract.cpp @@ -28,79 +28,76 @@ THE SOFTWARE. #endif -#define CHECK(cmd) \ -{\ - hipError_t error = cmd;\ - if (error != hipSuccess) { \ - fprintf(stderr, "error: '%s'(%d) at %s:%d\n", hipGetErrorString(error), error,__FILE__, __LINE__); \ - exit(EXIT_FAILURE);\ - }\ -} +#define CHECK(cmd) \ + { \ + hipError_t error = cmd; \ + if (error != hipSuccess) { \ + fprintf(stderr, "error: '%s'(%d) at %s:%d\n", hipGetErrorString(error), error, \ + __FILE__, __LINE__); \ + exit(EXIT_FAILURE); \ + } \ + } -__global__ void -bit_extract_kernel(hipLaunchParm lp, uint32_t *C_d, const uint32_t *A_d, size_t N) -{ +__global__ void bit_extract_kernel(hipLaunchParm lp, uint32_t* C_d, const uint32_t* A_d, size_t N) { size_t offset = (hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x); - size_t stride = hipBlockDim_x * hipGridDim_x ; + size_t stride = hipBlockDim_x * hipGridDim_x; - for (size_t i=offset; i> 8); + C_d[i] = ((A_d[i] & 0xf00) >> 8); #endif } } -int main(int argc, char *argv[]) -{ +int main(int argc, char* argv[]) { uint32_t *A_d, *C_d; uint32_t *A_h, *C_h; size_t N = 1000000; size_t Nbytes = N * sizeof(uint32_t); int deviceId; - CHECK (hipGetDevice(&deviceId)); + CHECK(hipGetDevice(&deviceId)); hipDeviceProp_t props; CHECK(hipGetDeviceProperties(&props, deviceId)); - printf ("info: running on device #%d %s\n", deviceId, props.name); + printf("info: running on device #%d %s\n", deviceId, props.name); - printf ("info: allocate host mem (%6.2f MB)\n", 2*Nbytes/1024.0/1024.0); + printf("info: allocate host mem (%6.2f MB)\n", 2 * Nbytes / 1024.0 / 1024.0); A_h = (uint32_t*)malloc(Nbytes); - CHECK(A_h == 0 ? hipErrorMemoryAllocation : hipSuccess ); + CHECK(A_h == 0 ? hipErrorMemoryAllocation : hipSuccess); C_h = (uint32_t*)malloc(Nbytes); - CHECK(C_h == 0 ? hipErrorMemoryAllocation : hipSuccess ); + CHECK(C_h == 0 ? hipErrorMemoryAllocation : hipSuccess); - for (size_t i=0; i> 8); if (C_h[i] != Agold) { - fprintf (stderr, "mismatch detected.\n"); - printf ("%zu: %08x =? %08x (Ain=%08x)\n", i, C_h[i], Agold, A_h[i]); + fprintf(stderr, "mismatch detected.\n"); + printf("%zu: %08x =? %08x (Ain=%08x)\n", i, C_h[i], Agold, A_h[i]); CHECK(hipErrorUnknown); } } - printf ("PASSED!\n"); + printf("PASSED!\n"); } diff --git a/hipamd/samples/0_Intro/hcc_dialects/vadd_amp_arrayview.cpp b/hipamd/samples/0_Intro/hcc_dialects/vadd_amp_arrayview.cpp index a3162bccb9..bb0a4157f8 100644 --- a/hipamd/samples/0_Intro/hcc_dialects/vadd_amp_arrayview.cpp +++ b/hipamd/samples/0_Intro/hcc_dialects/vadd_amp_arrayview.cpp @@ -26,8 +26,8 @@ THE SOFTWARE. // will automatically copy data to and from the host, without the user needing // to manually perform such copies. This is an excellent mode for developers // new to GPU programming and matches the memory models provided by recent systems where -// CPU and GPU share the same memory pool. Advanced programmers may prefer -// more explicit control over the data movement - shown in the other vadd_hc_array and +// CPU and GPU share the same memory pool. Advanced programmers may prefer +// more explicit control over the data movement - shown in the other vadd_hc_array and // vadd_hc_am examples. // This example shows the similarity between C++AMP and and HC for simple cases where // implicit data transfer is used - really the only difference is the namespace. @@ -35,8 +35,7 @@ THE SOFTWARE. #include -int main(int argc, char *argv[]) -{ +int main(int argc, char* argv[]) { int sizeElements = 1000000; bool pass = true; @@ -46,28 +45,30 @@ int main(int argc, char *argv[]) concurrency::array_view C(sizeElements); // Initialize host data - for (int i=0; i (sizeElements), - [=] (concurrency::index<1> idx) restrict(amp) { - int i = idx[0]; - C[i] = A[i] + B[i]; - }); + // The HCC runtime will ensure that A and B are available on the accelerator before launching + // the kernel. + concurrency::parallel_for_each(concurrency::extent<1>(sizeElements), + [=](concurrency::index<1> idx) restrict(amp) { + int i = idx[0]; + C[i] = A[i] + B[i]; + }); - for (int i=0; i #include -int main(int argc, char *argv[]) -{ +int main(int argc, char* argv[]) { int sizeElements = 1000000; size_t sizeBytes = sizeElements * sizeof(float); bool pass = true; // Allocate host memory - float *A_h = (float*)malloc(sizeBytes); - float *B_h = (float*)malloc(sizeBytes); - float *C_h = (float*)malloc(sizeBytes); + float* A_h = (float*)malloc(sizeBytes); + float* B_h = (float*)malloc(sizeBytes); + float* C_h = (float*)malloc(sizeBytes); // Allocate device pointers: // Unlike array_view, these must be explicitly managed by user: @@ -51,36 +50,37 @@ int main(int argc, char *argv[]) C_d = hc::am_alloc(sizeBytes, acc, 0); // Initialize host data - for (int i=0; i (sizeElements), - [=] (hc::index<1> idx) [[hc]] { - int i = idx[0]; - C_d[i] = A_d[i] + B_d[i]; - }); - - - // This copy is in same AV as the kernel and thus will wait for the kernel to finish before executing. - av.copy(C_d, C_h, sizeBytes); // C++ copy D2H + // and we don't need additional synchronization to ensure the copies complete before the PFE + // begins. + hc::completion_future cf = + hc::parallel_for_each(av, hc::extent<1>(sizeElements), [=](hc::index<1> idx)[[hc]] { + int i = idx[0]; + C_d[i] = A_d[i] + B_d[i]; + }); - for (int i=0; i -int main(int argc, char *argv[]) -{ +int main(int argc, char* argv[]) { int sizeElements = 1000000; size_t sizeBytes = sizeElements * sizeof(float); bool pass = true; // Allocate host memory - float *A_h = (float*)malloc(sizeBytes); - float *B_h = (float*)malloc(sizeBytes); - float *C_h = (float*)malloc(sizeBytes); + float* A_h = (float*)malloc(sizeBytes); + float* B_h = (float*)malloc(sizeBytes); + float* C_h = (float*)malloc(sizeBytes); // Allocate device arrays<> // Unlike array_view, these must be explicitly managed by user: @@ -47,32 +46,32 @@ int main(int argc, char *argv[]) hc::array C_d(sizeElements); // Initialize host data - for (int i=0; i types are not implicitly copied, so we performed copies above. - hc::parallel_for_each(hc::extent<1> (sizeElements), - [&] (hc::index<1> idx) [[hc]] { + hc::parallel_for_each(hc::extent<1>(sizeElements), [&](hc::index<1> idx)[[hc]] { int i = idx[0]; C_d[i] = A_d[i] + B_d[i]; }); - // HCC runtime knows that C_d depends on previous PFE and will force the copy to wait for the PFE to complte. - hc::copy(C_d, C_h); // C++ copy D2H + // HCC runtime knows that C_d depends on previous PFE and will force the copy to wait for the + // PFE to complte. + hc::copy(C_d, C_h); // C++ copy D2H - for (int i=0; i -int main(int argc, char *argv[]) -{ +int main(int argc, char* argv[]) { int sizeElements = 1000000; bool pass = true; @@ -46,28 +45,29 @@ int main(int argc, char *argv[]) hc::array_view C(sizeElements); // Initialize host data - for (int i=0; i (sizeElements), - [=] (hc::index<1> idx) [[hc]] { + // The HCC runtime will ensure that A and B are available on the accelerator before launching + // the kernel. + hc::parallel_for_each(hc::extent<1>(sizeElements), [=](hc::index<1> idx)[[hc]] { int i = idx[0]; C[i] = A[i] + B[i]; }); - for (int i=0; i -#include -#include +#include +#include +#include #define LEN 64 -#define SIZE LEN<<2 +#define SIZE LEN << 2 #define fileName "test.co" #define kernel_name "vadd" -int main(){ +int main() { float *A, *B, *C; hipDeviceptr_t Ad, Bd, Cd; A = new float[LEN]; B = new float[LEN]; C = new float[LEN]; - for(uint32_t i=0;i @@ -33,22 +32,25 @@ THE SOFTWARE. #endif #define LEN 64 -#define SIZE LEN<<2 +#define SIZE LEN << 2 #define fileName "vcpy_kernel.code.adipose" #define kernel_name "hello_world" -#define HIP_CHECK(status) \ -if(status != hipSuccess) {std::cout<<"Got Status: "< #define LEN 64 -#define SIZE LEN*sizeof(float) +#define SIZE LEN * sizeof(float) #define fileName "vcpy_kernel.code.adipose" float myDeviceGlobal; float myDeviceGlobalArray[16]; -#define HIP_CHECK(cmd) \ -{\ - hipError_t status = cmd;\ - if(status != hipSuccess) {std::cout<<"error: #"< #include "hip/hip_runtime.h" -#define CHECK(cmd) \ -{\ - hipError_t error = cmd;\ - if (error != hipSuccess) { \ - fprintf(stderr, "error: '%s'(%d) at %s:%d\n", hipGetErrorString(error), error,__FILE__, __LINE__); \ - exit(EXIT_FAILURE);\ - }\ -} +#define CHECK(cmd) \ + { \ + hipError_t error = cmd; \ + if (error != hipSuccess) { \ + fprintf(stderr, "error: '%s'(%d) at %s:%d\n", hipGetErrorString(error), error, \ + __FILE__, __LINE__); \ + exit(EXIT_FAILURE); \ + } \ + } /* * Square each element in the array A and write to array C. */ template -__global__ void -vector_square(hipLaunchParm lp, T *C_d, const T *A_d, size_t N) -{ +__global__ void vector_square(hipLaunchParm lp, T* C_d, const T* A_d, size_t N) { size_t offset = (hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x); - size_t stride = hipBlockDim_x * hipGridDim_x ; + size_t stride = hipBlockDim_x * hipGridDim_x; - for (size_t i=offset; i rhs.test) - return false; -#if (SORT_RETAIN_ATTS_ORDER == 0) +bool ResultDatabase::Result::operator<(const Result& rhs) const { + if (test < rhs.test) return true; + if (test > rhs.test) return false; +#if (SORT_RETAIN_ATTS_ORDER == 0) // For ties, sort by the value of the attribute: - if (atts < rhs.atts) - return true; - if (atts > rhs.atts) - return false; + if (atts < rhs.atts) return true; + if (atts > rhs.atts) return false; #endif - return false; // less-operator returns false on equal + return false; // less-operator returns false on equal } -double ResultDatabase::Result::GetMin() const -{ +double ResultDatabase::Result::GetMin() const { double r = FLT_MAX; - for (int i=0; i= 100) - return value[n-1]; + if (q <= 0) return value[0]; + if (q >= 100) return value[n - 1]; double index = ((n + 1.) * q / 100.) - 1; vector sorted = value; sort(sorted.begin(), sorted.end()); - if (n == 2) - return (sorted[0] * (1 - q/100.) + sorted[1] * (q/100.)); + if (n == 2) return (sorted[0] * (1 - q / 100.) + sorted[1] * (q / 100.)); int index_lo = int(index); double frac = index - index_lo; - if (frac == 0) - return sorted[index_lo]; + if (frac == 0) return sorted[index_lo]; double lo = sorted[index_lo]; double hi = sorted[index_lo + 1]; - return lo + (hi-lo)*frac; + return lo + (hi - lo) * frac; } -double ResultDatabase::Result::GetMean() const -{ +double ResultDatabase::Result::GetMean() const { double r = 0; - for (int i=0; i &values) -{ - for (int i=0; i& values) { + for (int i = 0; i < values.size(); i++) { AddResult(test, atts, unit, values[i]); } } -static string RemoveAllButLeadingSpaces(const string &a) -{ +static string RemoveAllButLeadingSpaces(const string& a) { string b; int n = a.length(); int i = 0; - while (i= results.size()) - { + if (index >= results.size()) { Result r; r.test = test; r.atts = atts; @@ -192,41 +152,33 @@ void ResultDatabase::AddResult(const string &test_orig, // Changed note about missing values to be worded a little better. // // **************************************************************************** -void ResultDatabase::DumpDetailed(ostream &out) -{ +void ResultDatabase::DumpDetailed(ostream& out) { vector sorted(results); stable_sort(sorted.begin(), sorted.end()); - const int testNameW = 24 ; + const int testNameW = 24; const int attW = 12; const int fieldW = 11; out << std::fixed << right << std::setprecision(4); int maxtrials = 1; - for (int i=0; i maxtrials) - maxtrials = sorted[i].value.size(); + for (int i = 0; i < sorted.size(); i++) { + if (sorted[i].value.size() > maxtrials) maxtrials = sorted[i].value.size(); } // TODO: in big parallel runs, the "trials" are the procs // and we really don't want to print them all out.... - out << setw(testNameW) << "test\t" - << setw(attW) << "atts\t" - << setw(fieldW) - << "median\t" + out << setw(testNameW) << "test\t" << setw(attW) << "atts\t" << setw(fieldW) << "median\t" << "mean\t" << "stddev\t" << "min\t" << "max\t"; - for (int i=0; i sorted(results); stable_sort(sorted.begin(), sorted.end()); - const int testNameW = 24 ; + const int testNameW = 24; const int attW = 12; const int fieldW = 9; out << std::fixed << right << std::setprecision(4); // TODO: in big parallel runs, the "trials" are the procs // and we really don't want to print them all out.... - out << setw(testNameW) << "test\t" - << setw(attW) << "atts\t" - << setw(fieldW) - << "units\t" + out << setw(testNameW) << "test\t" << setw(attW) << "atts\t" << setw(fieldW) << "units\t" << "median\t" << "mean\t" << "stddev\t" @@ -309,9 +256,8 @@ void ResultDatabase::DumpSummary(ostream &out) << "max\t"; out << endl; - for (int i=0; i sorted(results); stable_sort(sorted.begin(), sorted.end()); - //Check to see if the file is empty - if so, add the headers + // Check to see if the file is empty - if so, add the headers emptyFile = this->IsFileEmpty(fileName); - //Open file and append by default + // Open file and append by default ofstream out; - out.open(fileName.c_str(), std::ofstream::out | std::ofstream::app); + out.open(fileName.c_str(), std::ofstream::out | std::ofstream::app); - //Add headers only for empty files - if(emptyFile) - { - // TODO: in big parallel runs, the "trials" are the procs - // and we really don't want to print them all out.... - out << "test, " - << "atts, " - << "units, " - << "median, " - << "mean, " - << "stddev, " - << "min, " - << "max, "; - out << endl; + // Add headers only for empty files + if (emptyFile) { + // TODO: in big parallel runs, the "trials" are the procs + // and we really don't want to print them all out.... + out << "test, " + << "atts, " + << "units, " + << "median, " + << "mean, " + << "stddev, " + << "min, " + << "max, "; + out << endl; } - for (int i=0; i -ResultDatabase::GetResultsForTest(const string &test) -{ +vector ResultDatabase::GetResultsForTest(const string& test) { // get only the given test results vector retval; - for (int i=0; i & -ResultDatabase::GetResults() const -{ - return results; -} +const vector& ResultDatabase::GetResults() const { return results; } diff --git a/hipamd/samples/1_Utils/hipBusBandwidth/ResultDatabase.h b/hipamd/samples/1_Utils/hipBusBandwidth/ResultDatabase.h index 4b63a02a1f..ca6a00fc91 100644 --- a/hipamd/samples/1_Utils/hipBusBandwidth/ResultDatabase.h +++ b/hipamd/samples/1_Utils/hipBusBandwidth/ResultDatabase.h @@ -6,11 +6,11 @@ #include #include #include +using std::ifstream; +using std::ofstream; +using std::ostream; using std::string; using std::vector; -using std::ostream; -using std::ofstream; -using std::ifstream; // **************************************************************************** @@ -40,18 +40,16 @@ using std::ifstream; // Added a GetResults method as well, and made several functions const. // // **************************************************************************** -class ResultDatabase -{ - public: +class ResultDatabase { + public: // // A performance result for a single SHOC benchmark run. // - struct Result - { - string test; // e.g. "readback" - string atts; // e.g. "pagelocked 4k^2" - string unit; // e.g. "MB/sec" - vector value; // e.g. "837.14" + struct Result { + string test; // e.g. "readback" + string atts; // e.g. "pagelocked 4k^2" + string unit; // e.g. "MB/sec" + vector value; // e.g. "837.14" double GetMin() const; double GetMax() const; double GetMedian() const; @@ -59,41 +57,32 @@ class ResultDatabase double GetMean() const; double GetStdDev() const; - bool operator<(const Result &rhs) const; + bool operator<(const Result& rhs) const; - bool HadAnyFLTMAXValues() const - { - for (int i=0; i= FLT_MAX) - return true; + bool HadAnyFLTMAXValues() const { + for (int i = 0; i < value.size(); ++i) { + if (value[i] >= FLT_MAX) return true; } return false; } }; - protected: + protected: vector results; - public: - void AddResult(const string &test, - const string &atts, - const string &unit, - double value); - void AddResults(const string &test, - const string &atts, - const string &unit, - const vector &values); - vector GetResultsForTest(const string &test); - const vector &GetResults() const; + public: + void AddResult(const string& test, const string& atts, const string& unit, double value); + void AddResults(const string& test, const string& atts, const string& unit, + const vector& values); + vector GetResultsForTest(const string& test); + const vector& GetResults() const; void ClearAllResults(); void DumpDetailed(ostream&); void DumpSummary(ostream&); void DumpCsv(string fileName); - private: + private: bool IsFileEmpty(string fileName); - }; diff --git a/hipamd/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp b/hipamd/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp index 4bd1bc0163..bbeddf2f48 100644 --- a/hipamd/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp +++ b/hipamd/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp @@ -6,64 +6,67 @@ #include "ResultDatabase.h" -enum MallocMode {MallocPinned, MallocUnpinned, MallocRegistered}; +enum MallocMode { MallocPinned, MallocUnpinned, MallocRegistered }; // Cmdline parms: -bool p_verbose = false; -MallocMode p_malloc_mode = MallocPinned; -int p_numa_ctl = -1; -int p_iterations = 10; -int p_beatsperiteration=1; -int p_device = 0; -int p_detailed = 0; -bool p_async = 0; -int p_alignedhost = 0; // align host allocs to this granularity, in bytes. 64 or 4096 are good values to try. -int p_onesize = 0; +bool p_verbose = false; +MallocMode p_malloc_mode = MallocPinned; +int p_numa_ctl = -1; +int p_iterations = 10; +int p_beatsperiteration = 1; +int p_device = 0; +int p_detailed = 0; +bool p_async = 0; +int p_alignedhost = + 0; // align host allocs to this granularity, in bytes. 64 or 4096 are good values to try. +int p_onesize = 0; -bool p_h2d = true; -bool p_d2h = true; -bool p_bidir = true; -bool p_p2p = false; +bool p_h2d = true; +bool p_d2h = true; +bool p_bidir = true; +bool p_p2p = false; //#define NO_CHECK -#define CHECK_HIP_ERROR() \ -{ \ - hipError_t err = hipGetLastError(); \ - if (err != hipSuccess) \ - { \ - printf("error=%d name=%s at " \ - "ln: %d\n ",err,hipGetErrorString(err),__LINE__); \ - exit(EXIT_FAILURE); \ - } \ -} +#define CHECK_HIP_ERROR() \ + { \ + hipError_t err = hipGetLastError(); \ + if (err != hipSuccess) { \ + printf( \ + "error=%d name=%s at " \ + "ln: %d\n ", \ + err, hipGetErrorString(err), __LINE__); \ + exit(EXIT_FAILURE); \ + } \ + } std::string mallocModeString(int mallocMode) { switch (mallocMode) { - case MallocPinned : return "pinned"; - case MallocUnpinned: return "unpinned"; - case MallocRegistered: return "registered"; - default: return "mallocmode-UNKNOWN"; + case MallocPinned: + return "pinned"; + case MallocUnpinned: + return "unpinned"; + case MallocRegistered: + return "registered"; + default: + return "mallocmode-UNKNOWN"; }; }; // **************************************************************************** -int sizeToBytes(int size) { - return (size < 0) ? -size : size * 1024; -} +int sizeToBytes(int size) { return (size < 0) ? -size : size * 1024; } // **************************************************************************** -std::string sizeToString(int size) -{ +std::string sizeToString(int size) { using namespace std; stringstream ss; if (size < 0) { // char (-) lexically sorts before " " so will cause Byte values to be displayed before kB. - ss << "+" << setfill('0') << setw(3) << -size << "By"; + ss << "+" << setfill('0') << setw(3) << -size << "By"; } else { ss << size << "kB"; } @@ -72,8 +75,7 @@ std::string sizeToString(int size) // **************************************************************************** -hipError_t memcopy(void * dst, const void *src, size_t sizeBytes, enum hipMemcpyKind kind ) -{ +hipError_t memcopy(void* dst, const void* src, size_t sizeBytes, enum hipMemcpyKind kind) { if (p_async) { return hipMemcpyAsync(dst, src, sizeBytes, kind, NULL); } else { @@ -82,11 +84,11 @@ hipError_t memcopy(void * dst, const void *src, size_t sizeBytes, enum hipMemcpy } - // **************************************************************************** // -sizes are in bytes, +sizes are in kb, last size must be largest -int sizes[] = {-64, -256, -512, 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384, 32768,65536,131072,262144,524288}; -int nSizes = sizeof(sizes) / sizeof(int); +int sizes[] = {-64, -256, -512, 1, 2, 4, 8, 16, 32, 64, 128, 256, + 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288}; +int nSizes = sizeof(sizes) / sizeof(int); // **************************************************************************** @@ -108,74 +110,61 @@ int nSizes = sizeof(sizes) / sizeof(int); // Modifications: // Jeremy Meredith, Wed Dec 1 17:05:27 EST 2010 // Added calculation of latency estimate. -// Ben Sander - moved to standalone test +// Ben Sander - moved to standalone test // // **************************************************************************** -void RunBenchmark_H2D(ResultDatabase &resultDB) -{ - long long numMaxFloats = 1024 * (sizes[nSizes-1]) / 4; +void RunBenchmark_H2D(ResultDatabase& resultDB) { + long long numMaxFloats = 1024 * (sizes[nSizes - 1]) / 4; hipSetDevice(p_device); // Create some host memory pattern - float *hostMem = NULL; - if (p_malloc_mode == MallocPinned) - { + float* hostMem = NULL; + if (p_malloc_mode == MallocPinned) { hipHostMalloc((void**)&hostMem, sizeof(float) * numMaxFloats); - while (hipGetLastError() != hipSuccess) - { + while (hipGetLastError() != hipSuccess) { // drop the size and try again if (p_verbose) std::cout << " - dropping size allocating pinned mem\n"; --nSizes; - if (nSizes < 1) - { + if (nSizes < 1) { std::cerr << "Error: Couldn't allocate any pinned buffer\n"; - return; + return; } - numMaxFloats = 1024 * (sizes[nSizes-1]) / 4; + numMaxFloats = 1024 * (sizes[nSizes - 1]) / 4; hipHostMalloc((void**)&hostMem, sizeof(float) * numMaxFloats); } - } - else if (p_malloc_mode == MallocUnpinned) - { + } else if (p_malloc_mode == MallocUnpinned) { if (p_alignedhost) { - hostMem = (float*)aligned_alloc(p_alignedhost, numMaxFloats*sizeof(float)); + hostMem = (float*)aligned_alloc(p_alignedhost, numMaxFloats * sizeof(float)); } else { hostMem = new float[numMaxFloats]; } - } - else if (p_malloc_mode == MallocRegistered) - { + } else if (p_malloc_mode == MallocRegistered) { if (p_numa_ctl == -1) { - hostMem = (float*)malloc(numMaxFloats*sizeof(float)); + hostMem = (float*)malloc(numMaxFloats * sizeof(float)); } hipHostRegister(hostMem, numMaxFloats * sizeof(float), 0); CHECK_HIP_ERROR(); - } - else - { + } else { assert(0); } - for (int i = 0; i < numMaxFloats; i++) - { + for (int i = 0; i < numMaxFloats; i++) { hostMem[i] = i % 77; } - float *device; + float* device; hipMalloc((void**)&device, sizeof(float) * numMaxFloats); - while (hipGetLastError() != hipSuccess) - { + while (hipGetLastError() != hipSuccess) { // drop the size and try again if (p_verbose) std::cout << " - dropping size allocating device mem\n"; --nSizes; - if (nSizes < 1) - { + if (nSizes < 1) { std::cerr << "Error: Couldn't allocate any device buffer\n"; return; } - numMaxFloats = 1024 * (sizes[nSizes-1]) / 4; + numMaxFloats = 1024 * (sizes[nSizes - 1]) / 4; hipMalloc((void**)&device, sizeof(float) * numMaxFloats); } @@ -186,13 +175,11 @@ void RunBenchmark_H2D(ResultDatabase &resultDB) CHECK_HIP_ERROR(); // Three passes, forward and backward both - for (int pass = 0; pass < p_iterations; pass++) - { + for (int pass = 0; pass < p_iterations; pass++) { // store the times temporarily to estimate latency - //float times[nSizes]; + // float times[nSizes]; // Step through sizes forward on even passes and backward on odd - for (int i = 0; i < nSizes; i++) - { + for (int i = 0; i < nSizes; i++) { int sizeIndex; if ((pass % 2) == 0) sizeIndex = i; @@ -203,30 +190,32 @@ void RunBenchmark_H2D(ResultDatabase &resultDB) const int nbytes = sizeToBytes(thisSize); hipEventRecord(start, 0); - for (int j=0;j1) { + if (p_beatsperiteration > 1) { sprintf(sizeStr, "%9sx%d", sizeToString(thisSize).c_str(), p_beatsperiteration); } else { sprintf(sizeStr, "%9s", sizeToString(thisSize).c_str()); } - resultDB.AddResult(std::string("H2D_Bandwidth") + "_" + mallocModeString(p_malloc_mode), sizeStr, "GB/sec", speed); - resultDB.AddResult(std::string("H2D_Time") + mallocModeString(p_malloc_mode), sizeStr, "ms", t); + resultDB.AddResult(std::string("H2D_Bandwidth") + "_" + mallocModeString(p_malloc_mode), + sizeStr, "GB/sec", speed); + resultDB.AddResult(std::string("H2D_Time") + mallocModeString(p_malloc_mode), sizeStr, + "ms", t); if (p_onesize) { break; @@ -240,17 +229,16 @@ void RunBenchmark_H2D(ResultDatabase &resultDB) #ifndef NO_CHECK - // Check. First reset the host memory, then copy-back result. Then compare against original ref value. - for (int i = 0; i < numMaxFloats; i++) - { + // Check. First reset the host memory, then copy-back result. Then compare against original + // ref value. + for (int i = 0; i < numMaxFloats; i++) { hostMem[i] = 0; } - hipMemcpy(hostMem, device, numMaxFloats*sizeof(float), hipMemcpyDeviceToHost); - for (int i = 0; i < numMaxFloats; i++) - { + hipMemcpy(hostMem, device, numMaxFloats * sizeof(float), hipMemcpyDeviceToHost); + for (int i = 0; i < numMaxFloats; i++) { float ref = i % 77; if (ref != hostMem[i]) { - printf ("error: H2D. i=%d reference:%6.f != copyback:%6.2f\n", i, ref, hostMem[i]); + printf("error: H2D. i=%d reference:%6.f != copyback:%6.2f\n", i, ref, hostMem[i]); } } #endif @@ -260,26 +248,26 @@ void RunBenchmark_H2D(ResultDatabase &resultDB) hipFree((void*)device); CHECK_HIP_ERROR(); switch (p_malloc_mode) { - case MallocPinned: - hipHostFree((void*)hostMem); - CHECK_HIP_ERROR(); - break; + case MallocPinned: + hipHostFree((void*)hostMem); + CHECK_HIP_ERROR(); + break; - case MallocUnpinned: - if (p_alignedhost) { - delete[] hostMem; - } else { + case MallocUnpinned: + if (p_alignedhost) { + delete[] hostMem; + } else { + free(hostMem); + } + break; + + case MallocRegistered: + hipHostUnregister(hostMem); + CHECK_HIP_ERROR(); free(hostMem); - } - break; - - case MallocRegistered: - hipHostUnregister(hostMem); - CHECK_HIP_ERROR(); - free(hostMem); - break; - default: - assert(0); + break; + default: + assert(0); } @@ -288,85 +276,70 @@ void RunBenchmark_H2D(ResultDatabase &resultDB) } - // **************************************************************************** -void RunBenchmark_D2H(ResultDatabase &resultDB) -{ - long long numMaxFloats = 1024 * (sizes[nSizes-1]) / 4; +void RunBenchmark_D2H(ResultDatabase& resultDB) { + long long numMaxFloats = 1024 * (sizes[nSizes - 1]) / 4; // Create some host memory pattern - float *hostMem1; - float *hostMem2; - if (p_malloc_mode == MallocPinned) - { - hipHostMalloc((void**)&hostMem1, sizeof(float)*numMaxFloats); + float* hostMem1; + float* hostMem2; + if (p_malloc_mode == MallocPinned) { + hipHostMalloc((void**)&hostMem1, sizeof(float) * numMaxFloats); hipError_t err1 = hipGetLastError(); - hipHostMalloc((void**)&hostMem2, sizeof(float)*numMaxFloats); + hipHostMalloc((void**)&hostMem2, sizeof(float) * numMaxFloats); hipError_t err2 = hipGetLastError(); - while (err1 != hipSuccess || err2 != hipSuccess) - { + while (err1 != hipSuccess || err2 != hipSuccess) { // free the first buffer if only the second failed - if (err1 == hipSuccess) - hipHostFree((void*)hostMem1); + if (err1 == hipSuccess) hipHostFree((void*)hostMem1); // drop the size and try again if (p_verbose) std::cout << " - dropping size allocating pinned mem\n"; --nSizes; - if (nSizes < 1) - { + if (nSizes < 1) { std::cerr << "Error: Couldn't allocate any pinned buffer\n"; - return; + return; } - numMaxFloats = 1024 * (sizes[nSizes-1]) / 4; - hipHostMalloc((void**)&hostMem1, sizeof(float)*numMaxFloats); - err1 = hipGetLastError(); - hipHostMalloc((void**)&hostMem2, sizeof(float)*numMaxFloats); - err2 = hipGetLastError(); + numMaxFloats = 1024 * (sizes[nSizes - 1]) / 4; + hipHostMalloc((void**)&hostMem1, sizeof(float) * numMaxFloats); + err1 = hipGetLastError(); + hipHostMalloc((void**)&hostMem2, sizeof(float) * numMaxFloats); + err2 = hipGetLastError(); } - } - else if (p_malloc_mode == MallocUnpinned) - { + } else if (p_malloc_mode == MallocUnpinned) { hostMem1 = new float[numMaxFloats]; hostMem2 = new float[numMaxFloats]; - } - else if (p_malloc_mode == MallocRegistered) - { + } else if (p_malloc_mode == MallocRegistered) { if (p_numa_ctl == -1) { - hostMem1 = (float*)malloc(numMaxFloats*sizeof(float)); - hostMem2 = (float*)malloc(numMaxFloats*sizeof(float)); + hostMem1 = (float*)malloc(numMaxFloats * sizeof(float)); + hostMem2 = (float*)malloc(numMaxFloats * sizeof(float)); } hipHostRegister(hostMem1, numMaxFloats * sizeof(float), 0); CHECK_HIP_ERROR(); hipHostRegister(hostMem2, numMaxFloats * sizeof(float), 0); CHECK_HIP_ERROR(); - } - else - { + } else { assert(0); } - for (int i=0; i1) { + if (p_beatsperiteration > 1) { sprintf(sizeStr, "%9sx%d", sizeToString(thisSize).c_str(), p_beatsperiteration); } else { sprintf(sizeStr, "%9s", sizeToString(thisSize).c_str()); } - resultDB.AddResult(std::string("D2H_Bandwidth") +"_" + mallocModeString(p_malloc_mode) , sizeStr, "GB/sec", speed); - resultDB.AddResult(std::string("D2H_Time") +"_" + mallocModeString(p_malloc_mode) , sizeStr, "ms", t); + resultDB.AddResult(std::string("D2H_Bandwidth") + "_" + mallocModeString(p_malloc_mode), + sizeStr, "GB/sec", speed); + resultDB.AddResult(std::string("D2H_Time") + "_" + mallocModeString(p_malloc_mode), + sizeStr, "ms", t); if (p_onesize) { break; } @@ -427,12 +398,12 @@ void RunBenchmark_D2H(ResultDatabase &resultDB) if (p_onesize) { numMaxFloats = sizeToBytes(p_onesize) / sizeof(float); } - // Check. First reset the host memory, then copy-back result. Then compare against original ref value. - for (int i = 0; i < numMaxFloats; i++) - { + // Check. First reset the host memory, then copy-back result. Then compare against original + // ref value. + for (int i = 0; i < numMaxFloats; i++) { float ref = i % 77; if (ref != hostMem2[i]) { - printf ("error: D2H. i=%d reference:%6.f != copyback:%6.2f\n", i, ref, hostMem2[i]); + printf("error: D2H. i=%d reference:%6.f != copyback:%6.2f\n", i, ref, hostMem2[i]); } } @@ -441,25 +412,25 @@ void RunBenchmark_D2H(ResultDatabase &resultDB) CHECK_HIP_ERROR(); switch (p_malloc_mode) { - case MallocPinned: - hipHostFree((void*)hostMem1); - CHECK_HIP_ERROR(); - hipHostFree((void*)hostMem2); - CHECK_HIP_ERROR(); - break; - case MallocUnpinned: - delete[] hostMem1; - delete[] hostMem2; - break; - case MallocRegistered: - hipHostUnregister(hostMem1); - CHECK_HIP_ERROR(); - free(hostMem1); - hipHostUnregister(hostMem2); - free(hostMem2); - break; - default: - assert(0); + case MallocPinned: + hipHostFree((void*)hostMem1); + CHECK_HIP_ERROR(); + hipHostFree((void*)hostMem2); + CHECK_HIP_ERROR(); + break; + case MallocUnpinned: + delete[] hostMem1; + delete[] hostMem2; + break; + case MallocRegistered: + hipHostUnregister(hostMem1); + CHECK_HIP_ERROR(); + free(hostMem1); + hipHostUnregister(hostMem2); + free(hostMem2); + break; + default: + assert(0); } hipEventDestroy(start); @@ -467,9 +438,8 @@ void RunBenchmark_D2H(ResultDatabase &resultDB) } -void RunBenchmark_Bidir(ResultDatabase &resultDB) -{ - long long numMaxFloats = 1024 * (sizes[nSizes-1]) / 4; +void RunBenchmark_Bidir(ResultDatabase& resultDB) { + long long numMaxFloats = 1024 * (sizes[nSizes - 1]) / 4; hipSetDevice(p_device); @@ -477,11 +447,9 @@ void RunBenchmark_Bidir(ResultDatabase &resultDB) // Create some host memory pattern - float *hostMem[2] = {NULL, NULL}; - if (p_malloc_mode == MallocPinned) - { - while (1) - { + float* hostMem[2] = {NULL, NULL}; + if (p_malloc_mode == MallocPinned) { + while (1) { hipError_t e1 = hipHostMalloc((void**)&hostMem[0], sizeof(float) * numMaxFloats); hipError_t e2 = hipHostMalloc((void**)&hostMem[1], sizeof(float) * numMaxFloats); @@ -491,43 +459,35 @@ void RunBenchmark_Bidir(ResultDatabase &resultDB) // drop the size and try again if (p_verbose) std::cout << " - dropping size allocating pinned mem\n"; --nSizes; - if (nSizes < 1) - { + if (nSizes < 1) { std::cerr << "Error: Couldn't allocate any pinned buffer\n"; - return; + return; } - numMaxFloats = 1024 * (sizes[nSizes-1]) / 4; + numMaxFloats = 1024 * (sizes[nSizes - 1]) / 4; } } - } - else if (p_malloc_mode == MallocUnpinned) - { + } else if (p_malloc_mode == MallocUnpinned) { hostMem[0] = new float[numMaxFloats]; hostMem[1] = new float[numMaxFloats]; - } - else if (p_malloc_mode == MallocRegistered) - { + } else if (p_malloc_mode == MallocRegistered) { if (p_numa_ctl == -1) { - hostMem[0] = (float*)malloc(numMaxFloats*sizeof(float)); - hostMem[1] = (float*)malloc(numMaxFloats*sizeof(float)); + hostMem[0] = (float*)malloc(numMaxFloats * sizeof(float)); + hostMem[1] = (float*)malloc(numMaxFloats * sizeof(float)); } hipHostRegister(hostMem[0], numMaxFloats * sizeof(float), 0); CHECK_HIP_ERROR(); hipHostRegister(hostMem[1], numMaxFloats * sizeof(float), 0); CHECK_HIP_ERROR(); - } - else - { + } else { assert(0); } - for (int i = 0; i < numMaxFloats; i++) - { + for (int i = 0; i < numMaxFloats; i++) { hostMem[0][i] = i % 77; } - float *deviceMem[2]; + float* deviceMem[2]; while (1) { hipError_t e1 = hipMalloc((void**)&deviceMem[0], sizeof(float) * numMaxFloats); hipError_t e2 = hipMalloc((void**)&deviceMem[1], sizeof(float) * numMaxFloats); @@ -542,12 +502,11 @@ void RunBenchmark_Bidir(ResultDatabase &resultDB) // drop the size and try again if (p_verbose) std::cout << " - dropping size allocating device mem\n"; --nSizes; - if (nSizes < 1) - { + if (nSizes < 1) { std::cerr << "Error: Couldn't allocate any device buffer\n"; return; } - numMaxFloats = 1024 * (sizes[nSizes-1]) / 4; + numMaxFloats = 1024 * (sizes[nSizes - 1]) / 4; } }; @@ -563,13 +522,11 @@ void RunBenchmark_Bidir(ResultDatabase &resultDB) hipStreamCreate(&stream[1]); // Three passes, forward and backward both - for (int pass = 0; pass < p_iterations; pass++) - { + for (int pass = 0; pass < p_iterations; pass++) { // store the times temporarily to estimate latency - //float times[nSizes]; + // float times[nSizes]; // Step through sizes forward on even passes and backward on odd - for (int i = 0; i < nSizes; i++) - { + for (int i = 0; i < nSizes; i++) { int sizeIndex; if ((pass % 2) == 0) sizeIndex = i; @@ -580,25 +537,26 @@ void RunBenchmark_Bidir(ResultDatabase &resultDB) const int nbytes = sizeToBytes(thisSize); hipEventRecord(start, 0); - hipMemcpyAsync(deviceMem[0], hostMem[0], nbytes, hipMemcpyHostToDevice, stream[0]); - hipMemcpyAsync(hostMem[1], deviceMem[1], nbytes, hipMemcpyDeviceToHost, stream[1]); + hipMemcpyAsync(deviceMem[0], hostMem[0], nbytes, hipMemcpyHostToDevice, stream[0]); + hipMemcpyAsync(hostMem[1], deviceMem[1], nbytes, hipMemcpyDeviceToHost, stream[1]); hipEventRecord(stop, 0); hipEventSynchronize(stop); float t = 0; hipEventElapsedTime(&t, start, stop); // Convert to GB/sec - if (p_verbose) - { - std::cerr << "size " << sizeToString(thisSize) << " took " << t << - " ms\n"; + if (p_verbose) { + std::cerr << "size " << sizeToString(thisSize) << " took " << t << " ms\n"; } - double speed = (double(sizeToBytes(2*thisSize)) / (1000*1000)) / t; + double speed = (double(sizeToBytes(2 * thisSize)) / (1000 * 1000)) / t; char sizeStr[256]; sprintf(sizeStr, "%9s", sizeToString(thisSize).c_str()); - resultDB.AddResult(std::string("Bidir_Bandwidth") + "_" + mallocModeString(p_malloc_mode), sizeStr, "GB/sec", speed); - resultDB.AddResult(std::string("Bidir_Time") + "_" + mallocModeString(p_malloc_mode), sizeStr, "ms", t); + resultDB.AddResult( + std::string("Bidir_Bandwidth") + "_" + mallocModeString(p_malloc_mode), sizeStr, + "GB/sec", speed); + resultDB.AddResult(std::string("Bidir_Time") + "_" + mallocModeString(p_malloc_mode), + sizeStr, "ms", t); } } @@ -607,24 +565,24 @@ void RunBenchmark_Bidir(ResultDatabase &resultDB) hipFree((void*)deviceMem[1]); CHECK_HIP_ERROR(); switch (p_malloc_mode) { - case MallocPinned: - hipHostFree((void*)hostMem[0]); - hipHostFree((void*)hostMem[1]); - CHECK_HIP_ERROR(); - break; - case MallocUnpinned: - delete[] hostMem[0]; - delete[] hostMem[1]; - break; - case MallocRegistered: - for (int i=0; i<2; i++) { - hipHostUnregister(hostMem[i]); + case MallocPinned: + hipHostFree((void*)hostMem[0]); + hipHostFree((void*)hostMem[1]); CHECK_HIP_ERROR(); - free(hostMem[i]); - } - break; - default: - assert(0); + break; + case MallocUnpinned: + delete[] hostMem[0]; + delete[] hostMem[1]; + break; + case MallocRegistered: + for (int i = 0; i < 2; i++) { + hipHostUnregister(hostMem[i]); + CHECK_HIP_ERROR(); + free(hostMem[i]); + } + break; + default: + assert(0); }; hipEventDestroy(start); @@ -634,37 +592,31 @@ void RunBenchmark_Bidir(ResultDatabase &resultDB) } - - - -#define failed(...) \ - printf ("error: ");\ - printf (__VA_ARGS__);\ - printf ("\n");\ +#define failed(...) \ + printf("error: "); \ + printf(__VA_ARGS__); \ + printf("\n"); \ exit(EXIT_FAILURE); -int parseInt(const char *str, int *output) -{ - char *next; +int parseInt(const char* str, int* output) { + char* next; *output = strtol(str, &next, 0); return !strlen(next); } -void checkPeer2PeerSupport() -{ +void checkPeer2PeerSupport() { int deviceCnt; hipGetDeviceCount(&deviceCnt); std::cout << "Total no. of available gpu #" << deviceCnt << "\n" << std::endl; - for(int deviceId=0; deviceIdhost then host-->GPU2)\n\n" << std::endl; + std::cout << "\nNote: For non-supported peer2peer devices, memcopy will use/follow the normal " + "behaviour (GPU1-->host then host-->GPU2)\n\n" + << std::endl; } -void enablePeer2Peer(int currentGpu, int peerGpu) -{ +void enablePeer2Peer(int currentGpu, int peerGpu) { int canAccessPeer; hipSetDevice(currentGpu); hipDeviceCanAccessPeer(&canAccessPeer, currentGpu, peerGpu); - if(canAccessPeer==1){ + if (canAccessPeer == 1) { hipDeviceEnablePeerAccess(peerGpu, 0); } } -void disablePeer2Peer(int currentGpu, int peerGpu) -{ +void disablePeer2Peer(int currentGpu, int peerGpu) { int canAccessPeer; hipSetDevice(currentGpu); hipDeviceCanAccessPeer(&canAccessPeer, currentGpu, peerGpu); - if(canAccessPeer==1){ + if (canAccessPeer == 1) { hipDeviceDisablePeerAccess(peerGpu); } } -std::string gpuIDToString(int gpuID) -{ +std::string gpuIDToString(int gpuID) { using namespace std; stringstream ss; - ss << gpuID; + ss << gpuID; return ss.str(); } -void RunBenchmark_P2P_Unidir(ResultDatabase &resultDB) -{ +void RunBenchmark_P2P_Unidir(ResultDatabase& resultDB) { int gpuCount; hipGetDeviceCount(&gpuCount); int currentGpu, peerGpu; - long long numMaxFloats = 1024 * (sizes[nSizes-1]) / 4; + long long numMaxFloats = 1024 * (sizes[nSizes - 1]) / 4; - for (currentGpu=0; currentGpu1) { - sprintf(sizeStr, "%9sx%d", sizeToString(thisSize).c_str(), p_beatsperiteration); + if (p_beatsperiteration > 1) { + sprintf(sizeStr, "%9sx%d", sizeToString(thisSize).c_str(), + p_beatsperiteration); } else { sprintf(sizeStr, "%9s", sizeToString(thisSize).c_str()); } @@ -809,14 +757,17 @@ void RunBenchmark_P2P_Unidir(ResultDatabase &resultDB) cGpu = gpuIDToString(currentGpu); pGpu = gpuIDToString(peerGpu); - resultDB.AddResult(std::string("p2p_uni") + "_gpu" + std::string(cGpu)+ "_gpu" + std::string(pGpu), sizeStr, "GB/sec", speed); - resultDB.AddResult(std::string("P2P_uni") + "_gpu" + std::string(cGpu)+ "_gpu" + std::string(pGpu), sizeStr, "ms", t); + resultDB.AddResult(std::string("p2p_uni") + "_gpu" + std::string(cGpu) + + "_gpu" + std::string(pGpu), + sizeStr, "GB/sec", speed); + resultDB.AddResult(std::string("P2P_uni") + "_gpu" + std::string(cGpu) + + "_gpu" + std::string(pGpu), + sizeStr, "ms", t); if (p_onesize) { break; } } - } if (p_onesize) { @@ -839,13 +790,10 @@ void RunBenchmark_P2P_Unidir(ResultDatabase &resultDB) hipSetDevice(currentGpu); hipDeviceReset(); } - } - } -void RunBenchmark_P2P_Bidir(ResultDatabase &resultDB) { - +void RunBenchmark_P2P_Bidir(ResultDatabase& resultDB) { int gpuCount; hipGetDeviceCount(&gpuCount); @@ -853,14 +801,11 @@ void RunBenchmark_P2P_Bidir(ResultDatabase &resultDB) { int currentGpu, peerGpu; - long long numMaxFloats = 1024 * (sizes[nSizes-1]) / 4; + long long numMaxFloats = 1024 * (sizes[nSizes - 1]) / 4; - for (currentGpu=0; currentGpu1) { - sprintf(sizeStr, "%9sx%d", sizeToString(thisSize).c_str(), p_beatsperiteration); + if (p_beatsperiteration > 1) { + sprintf(sizeStr, "%9sx%d", sizeToString(thisSize).c_str(), + p_beatsperiteration); } else { sprintf(sizeStr, "%9s", sizeToString(thisSize).c_str()); } @@ -934,14 +881,17 @@ void RunBenchmark_P2P_Bidir(ResultDatabase &resultDB) { cGpu = gpuIDToString(currentGpu); pGpu = gpuIDToString(peerGpu); - resultDB.AddResult(std::string("p2p_bi") + "_gpu" + std::string(cGpu)+ "_gpu" + std::string(pGpu), sizeStr, "GB/sec", speed); - resultDB.AddResult(std::string("P2P_bi") + "_gpu" + std::string(cGpu)+ "_gpu" + std::string(pGpu), sizeStr, "ms", t); + resultDB.AddResult(std::string("p2p_bi") + "_gpu" + std::string(cGpu) + "_gpu" + + std::string(pGpu), + sizeStr, "GB/sec", speed); + resultDB.AddResult(std::string("P2P_bi") + "_gpu" + std::string(cGpu) + "_gpu" + + std::string(pGpu), + sizeStr, "ms", t); if (p_onesize) { break; } } - } if (p_onesize) { @@ -953,7 +903,7 @@ void RunBenchmark_P2P_Bidir(ResultDatabase &resultDB) { hipEventDestroy(start); hipEventDestroy(stop); - for (int i=0; i<2; i++) { + for (int i = 0; i < 2; i++) { hipStreamDestroy(stream[i]); hipFree((void*)currentGpuMem[i]); @@ -975,75 +925,81 @@ void printConfig() { hipDeviceProp_t props; hipGetDeviceProperties(&props, p_device); - printf ("Device:%s Mem=%.1fGB #CUs=%d Freq=%.0fMhz MallocMode=%s\n", props.name, props.totalGlobalMem/1024.0/1024.0/1024.0, props.multiProcessorCount, props.clockRate/1000.0, mallocModeString(p_malloc_mode).c_str()); + printf("Device:%s Mem=%.1fGB #CUs=%d Freq=%.0fMhz MallocMode=%s\n", props.name, + props.totalGlobalMem / 1024.0 / 1024.0 / 1024.0, props.multiProcessorCount, + props.clockRate / 1000.0, mallocModeString(p_malloc_mode).c_str()); } void help() { - printf ("Usage: hipBusBandwidth [OPTIONS]\n"); - printf (" --iterations, -i : Number of copy iterations to run.\n"); - printf (" --beatsperiterations, -b : Number of beats (back-to-back copies of same size) per iteration to run.\n"); - printf (" --device, -d : Device ID to use (0..numDevices).\n"); - printf (" --unpinned : Use unpinned host memory.\n"); - printf (" --d2h : Run only device-to-host test.\n"); - printf (" --h2d : Run only host-to-device test.\n"); - printf (" --bidir : Run only bidir copy test.\n"); - printf (" --p2p : Run only peer2peer unidir and bidir copy tests.\n"); - printf (" --verbose : Print verbose status messages as test is run.\n"); - printf (" --detailed : Print detailed report (including all trials).\n"); - printf (" --async : Use hipMemcpyAsync(with NULL stream) for H2D/D2H. Default uses hipMemcpy.\n"); - printf (" --onesize, -o : Only run one measurement, at specified size (in KB, or if negative in bytes)\n"); - + printf("Usage: hipBusBandwidth [OPTIONS]\n"); + printf(" --iterations, -i : Number of copy iterations to run.\n"); + printf( + " --beatsperiterations, -b : Number of beats (back-to-back copies of same size) per " + "iteration to run.\n"); + printf(" --device, -d : Device ID to use (0..numDevices).\n"); + printf(" --unpinned : Use unpinned host memory.\n"); + printf(" --d2h : Run only device-to-host test.\n"); + printf(" --h2d : Run only host-to-device test.\n"); + printf(" --bidir : Run only bidir copy test.\n"); + printf(" --p2p : Run only peer2peer unidir and bidir copy tests.\n"); + printf(" --verbose : Print verbose status messages as test is run.\n"); + printf(" --detailed : Print detailed report (including all trials).\n"); + printf( + " --async : Use hipMemcpyAsync(with NULL stream) for H2D/D2H. Default " + "uses hipMemcpy.\n"); + printf( + " --onesize, -o : Only run one measurement, at specified size (in KB, or if " + "negative in bytes)\n"); }; -int parseStandardArguments(int argc, char *argv[]) -{ +int parseStandardArguments(int argc, char* argv[]) { for (int i = 1; i < argc; i++) { - const char *arg = argv[i]; + const char* arg = argv[i]; if (!strcmp(arg, " ")) { // skip NULL args. } else if (!strcmp(arg, "--iterations") || (!strcmp(arg, "-i"))) { if (++i >= argc || !parseInt(argv[i], &p_iterations)) { - failed("Bad iterations argument"); + failed("Bad iterations argument"); } } else if (!strcmp(arg, "--beatsperiteration") || (!strcmp(arg, "-b"))) { if (++i >= argc || !parseInt(argv[i], &p_beatsperiteration)) { - failed("Bad beatsperiteration argument"); + failed("Bad beatsperiteration argument"); } } else if (!strcmp(arg, "--device") || (!strcmp(arg, "-d"))) { if (++i >= argc || !parseInt(argv[i], &p_device)) { - failed("Bad device argument"); + failed("Bad device argument"); } } else if (!strcmp(arg, "--onesize") || (!strcmp(arg, "-o"))) { if (++i >= argc || !parseInt(argv[i], &p_onesize)) { - failed("Bad onesize argument"); + failed("Bad onesize argument"); } } else if (!strcmp(arg, "--unpinned")) { p_malloc_mode = MallocUnpinned; } else if (!strcmp(arg, "--registered")) { p_malloc_mode = MallocRegistered; } else if (!strcmp(arg, "--h2d")) { - p_h2d = true; - p_d2h = false; + p_h2d = true; + p_d2h = false; p_bidir = false; } else if (!strcmp(arg, "--d2h")) { - p_h2d = false; - p_d2h = true; + p_h2d = false; + p_d2h = true; p_bidir = false; } else if (!strcmp(arg, "--bidir")) { - p_h2d = false; - p_d2h = false; + p_h2d = false; + p_d2h = false; p_bidir = true; } else if (!strcmp(arg, "--p2p")) { - p_h2d = false; - p_d2h = false; + p_h2d = false; + p_d2h = false; p_bidir = false; - p_p2p = true; + p_p2p = true; - } else if (!strcmp(arg, "--help") || (!strcmp(arg, "-h"))) { + } else if (!strcmp(arg, "--help") || (!strcmp(arg, "-h"))) { help(); exit(EXIT_SUCCESS); @@ -1057,15 +1013,13 @@ int parseStandardArguments(int argc, char *argv[]) } else { failed("Bad argument '%s'", arg); } - } + } return 0; }; - -int main(int argc, char *argv[]) -{ +int main(int argc, char* argv[]) { parseStandardArguments(argc, argv); if (p_p2p) { @@ -1083,8 +1037,7 @@ int main(int argc, char *argv[]) resultDB_Unidir.DumpDetailed(std::cout); resultDB_Bidir.DumpDetailed(std::cout); } - } - else { + } else { printConfig(); if (p_h2d) { diff --git a/hipamd/samples/1_Utils/hipCommander/ResultDatabase.cpp b/hipamd/samples/1_Utils/hipCommander/ResultDatabase.cpp index 2ec686f260..1b1ee3a70d 100644 --- a/hipamd/samples/1_Utils/hipCommander/ResultDatabase.cpp +++ b/hipamd/samples/1_Utils/hipCommander/ResultDatabase.cpp @@ -7,93 +7,69 @@ using namespace std; -bool ResultDatabase::Result::operator<(const Result &rhs) const -{ - if (test < rhs.test) - return true; - if (test > rhs.test) - return false; - if (atts < rhs.atts) - return true; - if (atts > rhs.atts) - return false; - return false; // less-operator returns false on equal +bool ResultDatabase::Result::operator<(const Result& rhs) const { + if (test < rhs.test) return true; + if (test > rhs.test) return false; + if (atts < rhs.atts) return true; + if (atts > rhs.atts) return false; + return false; // less-operator returns false on equal } -double ResultDatabase::Result::GetMin() const -{ +double ResultDatabase::Result::GetMin() const { double r = FLT_MAX; - for (int i=0; i= 100) - return value[n-1]; + if (q <= 0) return value[0]; + if (q >= 100) return value[n - 1]; double index = ((n + 1.) * q / 100.) - 1; vector sorted = value; sort(sorted.begin(), sorted.end()); - if (n == 2) - return (sorted[0] * (1 - q/100.) + sorted[1] * (q/100.)); + if (n == 2) return (sorted[0] * (1 - q / 100.) + sorted[1] * (q / 100.)); int index_lo = int(index); double frac = index - index_lo; - if (frac == 0) - return sorted[index_lo]; + if (frac == 0) return sorted[index_lo]; double lo = sorted[index_lo]; double hi = sorted[index_lo + 1]; - return lo + (hi-lo)*frac; + return lo + (hi - lo) * frac; } -double ResultDatabase::Result::GetMean() const -{ +double ResultDatabase::Result::GetMean() const { double r = 0; - for (int i=0; i &values) -{ - for (int i=0; i& values) { + for (int i = 0; i < values.size(); i++) { AddResult(test, atts, unit, values[i]); } } -static string RemoveAllButLeadingSpaces(const string &a) -{ +static string RemoveAllButLeadingSpaces(const string& a) { string b; int n = a.length(); int i = 0; - while (i= results.size()) - { + if (index >= results.size()) { Result r; r.test = test; r.atts = atts; @@ -186,40 +146,32 @@ void ResultDatabase::AddResult(const string &test_orig, // Changed note about missing values to be worded a little better. // // **************************************************************************** -void ResultDatabase::DumpDetailed(ostream &out) -{ +void ResultDatabase::DumpDetailed(ostream& out) { vector sorted(results); sort(sorted.begin(), sorted.end()); - const int testNameW = 24 ; + const int testNameW = 24; const int attW = 12; const int fieldW = 11; out << std::fixed << right << std::setprecision(4); int maxtrials = 1; - for (int i=0; i maxtrials) - maxtrials = sorted[i].value.size(); + for (int i = 0; i < sorted.size(); i++) { + if (sorted[i].value.size() > maxtrials) maxtrials = sorted[i].value.size(); } // TODO: in big parallel runs, the "trials" are the procs // and we really don't want to print them all out.... - out << setw(testNameW) << "test\t" - << setw(attW) << "atts\t" - << setw(fieldW) - << "median\t" + out << setw(testNameW) << "test\t" << setw(attW) << "atts\t" << setw(fieldW) << "median\t" << "mean\t" << "stddev\t" << "min\t" << "max\t"; - for (int i=0; i sorted(results); sort(sorted.begin(), sorted.end()); - const int testNameW = 24 ; + const int testNameW = 24; const int attW = 12; const int fieldW = 9; out << std::fixed << right << std::setprecision(4); // TODO: in big parallel runs, the "trials" are the procs // and we really don't want to print them all out.... - out << setw(testNameW) << "test\t" - << setw(attW) << "atts\t" - << setw(fieldW) - << "units\t" + out << setw(testNameW) << "test\t" << setw(attW) << "atts\t" << setw(fieldW) << "units\t" << "median\t" << "mean\t" << "stddev\t" @@ -301,9 +248,8 @@ void ResultDatabase::DumpSummary(ostream &out) << "max\t"; out << endl; - for (int i=0; i sorted(results); sort(sorted.begin(), sorted.end()); - //Check to see if the file is empty - if so, add the headers + // Check to see if the file is empty - if so, add the headers emptyFile = this->IsFileEmpty(fileName); - //Open file and append by default + // Open file and append by default ofstream out; - out.open(fileName.c_str(), std::ofstream::out | std::ofstream::app); + out.open(fileName.c_str(), std::ofstream::out | std::ofstream::app); - //Add headers only for empty files - if(emptyFile) - { - // TODO: in big parallel runs, the "trials" are the procs - // and we really don't want to print them all out.... - out << "test, " - << "atts, " - << "units, " - << "median, " - << "mean, " - << "stddev, " - << "min, " - << "max, "; - out << endl; + // Add headers only for empty files + if (emptyFile) { + // TODO: in big parallel runs, the "trials" are the procs + // and we really don't want to print them all out.... + out << "test, " + << "atts, " + << "units, " + << "median, " + << "mean, " + << "stddev, " + << "min, " + << "max, "; + out << endl; } - for (int i=0; i -ResultDatabase::GetResultsForTest(const string &test) -{ +vector ResultDatabase::GetResultsForTest(const string& test) { // get only the given test results vector retval; - for (int i=0; i & -ResultDatabase::GetResults() const -{ - return results; -} +const vector& ResultDatabase::GetResults() const { return results; } diff --git a/hipamd/samples/1_Utils/hipCommander/ResultDatabase.h b/hipamd/samples/1_Utils/hipCommander/ResultDatabase.h index 4b63a02a1f..ca6a00fc91 100644 --- a/hipamd/samples/1_Utils/hipCommander/ResultDatabase.h +++ b/hipamd/samples/1_Utils/hipCommander/ResultDatabase.h @@ -6,11 +6,11 @@ #include #include #include +using std::ifstream; +using std::ofstream; +using std::ostream; using std::string; using std::vector; -using std::ostream; -using std::ofstream; -using std::ifstream; // **************************************************************************** @@ -40,18 +40,16 @@ using std::ifstream; // Added a GetResults method as well, and made several functions const. // // **************************************************************************** -class ResultDatabase -{ - public: +class ResultDatabase { + public: // // A performance result for a single SHOC benchmark run. // - struct Result - { - string test; // e.g. "readback" - string atts; // e.g. "pagelocked 4k^2" - string unit; // e.g. "MB/sec" - vector value; // e.g. "837.14" + struct Result { + string test; // e.g. "readback" + string atts; // e.g. "pagelocked 4k^2" + string unit; // e.g. "MB/sec" + vector value; // e.g. "837.14" double GetMin() const; double GetMax() const; double GetMedian() const; @@ -59,41 +57,32 @@ class ResultDatabase double GetMean() const; double GetStdDev() const; - bool operator<(const Result &rhs) const; + bool operator<(const Result& rhs) const; - bool HadAnyFLTMAXValues() const - { - for (int i=0; i= FLT_MAX) - return true; + bool HadAnyFLTMAXValues() const { + for (int i = 0; i < value.size(); ++i) { + if (value[i] >= FLT_MAX) return true; } return false; } }; - protected: + protected: vector results; - public: - void AddResult(const string &test, - const string &atts, - const string &unit, - double value); - void AddResults(const string &test, - const string &atts, - const string &unit, - const vector &values); - vector GetResultsForTest(const string &test); - const vector &GetResults() const; + public: + void AddResult(const string& test, const string& atts, const string& unit, double value); + void AddResults(const string& test, const string& atts, const string& unit, + const vector& values); + vector GetResultsForTest(const string& test); + const vector& GetResults() const; void ClearAllResults(); void DumpDetailed(ostream&); void DumpSummary(ostream&); void DumpCsv(string fileName); - private: + private: bool IsFileEmpty(string fileName); - }; diff --git a/hipamd/samples/1_Utils/hipCommander/hipCommander.cpp b/hipamd/samples/1_Utils/hipCommander/hipCommander.cpp index 4b93180b18..345c2d5006 100644 --- a/hipamd/samples/1_Utils/hipCommander/hipCommander.cpp +++ b/hipamd/samples/1_Utils/hipCommander/hipCommander.cpp @@ -21,55 +21,46 @@ bool g_printedTiming = false; // Cmdline parms: -int p_device = 0; -const char* p_command = "setstream(1); H2D; NullKernel; D2H;"; -const char* p_file = nullptr; -unsigned p_verbose = 0x0; -unsigned p_db = 0x0; -unsigned p_blockingSync = 0x0; +int p_device = 0; +const char* p_command = "setstream(1); H2D; NullKernel; D2H;"; +const char* p_file = nullptr; +unsigned p_verbose = 0x0; +unsigned p_db = 0x0; +unsigned p_blockingSync = 0x0; //--- -int p_iterations = 1; +int p_iterations = 1; -#define KNRM "\x1B[0m" -#define KRED "\x1B[31m" -#define KGRN "\x1B[32m" +#define KNRM "\x1B[0m" +#define KRED "\x1B[31m" +#define KGRN "\x1B[32m" -#define failed(...) \ - printf ("error: ");\ - printf (__VA_ARGS__);\ - printf ("\n");\ +#define failed(...) \ + printf("error: "); \ + printf(__VA_ARGS__); \ + printf("\n"); \ abort(); -#define HIPCHECK(error) \ -{\ - hipError_t localError = error; \ - if (localError != hipSuccess) { \ - printf("%serror: '%s'(%d) from %s at %s:%d%s\n", \ - KRED,hipGetErrorString(localError), localError,\ - #error,\ - __FILE__, __LINE__,KNRM); \ - failed("API returned error code.");\ - }\ -} -#define HIPASSERT(condition, msg) \ - if (! (condition) ) { \ - failed("%sassertion %s at %s:%d: %s%s\n", \ - KRED, #condition,\ - __FILE__, __LINE__,msg, KNRM); \ +#define HIPCHECK(error) \ + { \ + hipError_t localError = error; \ + if (localError != hipSuccess) { \ + printf("%serror: '%s'(%d) from %s at %s:%d%s\n", KRED, hipGetErrorString(localError), \ + localError, #error, __FILE__, __LINE__, KNRM); \ + failed("API returned error code."); \ + } \ + } +#define HIPASSERT(condition, msg) \ + if (!(condition)) { \ + failed("%sassertion %s at %s:%d: %s%s\n", KRED, #condition, __FILE__, __LINE__, msg, \ + KNRM); \ } - - - - - -int parseInt(const char *str, int *output) -{ - char *next; +int parseInt(const char* str, int* output) { + char* next; *output = strtol(str, &next, 0); return !strlen(next); } @@ -79,50 +70,50 @@ void printConfig() { hipDeviceProp_t props; HIPCHECK(hipGetDeviceProperties(&props, p_device)); - printf ("Device:%s Mem=%.1fGB #CUs=%d Freq=%.0fMhz\n", props.name, props.totalGlobalMem/1024.0/1024.0/1024.0, props.multiProcessorCount, props.clockRate/1000.0); + printf("Device:%s Mem=%.1fGB #CUs=%d Freq=%.0fMhz\n", props.name, + props.totalGlobalMem / 1024.0 / 1024.0 / 1024.0, props.multiProcessorCount, + props.clockRate / 1000.0); } - - void help() { - printf ("Usage: hipBusBandwidth [OPTIONS]\n"); - printf (" --file, -f : Read string of commands from file\n"); - printf (" --command, -c : String specifying commands to run.\n"); - printf (" --iterations, -i : Number of copy iterations to run.\n"); - printf (" --device, -d : Device ID to use (0..numDevices).\n"); - printf (" --verbose, -v : Verbose printing of status. Fore more info, combine with HIP_TRACE_API on ROCm\n"); + printf("Usage: hipBusBandwidth [OPTIONS]\n"); + printf(" --file, -f : Read string of commands from file\n"); + printf(" --command, -c : String specifying commands to run.\n"); + printf(" --iterations, -i : Number of copy iterations to run.\n"); + printf(" --device, -d : Device ID to use (0..numDevices).\n"); + printf( + " --verbose, -v : Verbose printing of status. Fore more info, combine with " + "HIP_TRACE_API on ROCm\n"); }; - -int parseStandardArguments(int argc, char *argv[]) -{ +int parseStandardArguments(int argc, char* argv[]) { for (int i = 1; i < argc; i++) { - const char *arg = argv[i]; + const char* arg = argv[i]; if (!strcmp(arg, " ")) { // skip NULL args. } else if (!strcmp(arg, "--iterations") || (!strcmp(arg, "-i"))) { if (++i >= argc || !parseInt(argv[i], &p_iterations)) { - failed("Bad --iterations argument"); + failed("Bad --iterations argument"); } } else if (!strcmp(arg, "--device") || (!strcmp(arg, "-d"))) { if (++i >= argc || !parseInt(argv[i], &p_device)) { - failed("Bad --device argument"); + failed("Bad --device argument"); } } else if (!strcmp(arg, "--file") || (!strcmp(arg, "-f"))) { if (++i >= argc) { - failed("Bad --file argument"); + failed("Bad --file argument"); } else { p_file = argv[i]; } } else if (!strcmp(arg, "--commands") || (!strcmp(arg, "-c"))) { if (++i >= argc) { - failed("Bad --commands argument"); + failed("Bad --commands argument"); } else { p_command = argv[i]; } @@ -134,21 +125,20 @@ int parseStandardArguments(int argc, char *argv[]) p_blockingSync = 1; - } else if (!strcmp(arg, "--help") || (!strcmp(arg, "-h"))) { + } else if (!strcmp(arg, "--help") || (!strcmp(arg, "-h"))) { help(); exit(EXIT_SUCCESS); } else { failed("Bad argument '%s'", arg); } - } + } return 0; }; // Returns the current system time in microseconds -inline long long get_time() -{ +inline long long get_time() { struct timeval tv; gettimeofday(&tv, 0); return (tv.tv_sec * 1000000) + tv.tv_usec; @@ -161,142 +151,132 @@ class Command; //================================================================================================= // A stream of commands , specified as a string. class CommandStream { -public: + public: // State that is inherited by sub-blocks: struct CommandStreamState { - hipStream_t _currentStream; - std::vector _streams; - vector _subBlocks; + hipStream_t _currentStream; + std::vector _streams; + vector _subBlocks; }; -public: + + public: CommandStream(std::string commandStreamString, int iterations); ~CommandStream(); hipStream_t currentStream() const { return _state._currentStream; }; - void print(const std::string &indent="") const; - void printBrief(std::ostream &s=std::cout) const ; + void print(const std::string& indent = "") const; + void printBrief(std::ostream& s = std::cout) const; void run(); void recordTime(); - void printTiming(int iterations=0); + void printTiming(int iterations = 0); - CommandStream *currentCommandStream() { + CommandStream* currentCommandStream() { return _parseInSubBlock ? _state._subBlocks.back() : this; }; - void enterSubBlock(CommandStream *commandStream) { + void enterSubBlock(CommandStream* commandStream) { _parseInSubBlock = true; _state._subBlocks.push_back(commandStream); }; - void exitSubBlock() { - _parseInSubBlock = false; - }; + void exitSubBlock() { _parseInSubBlock = false; }; - void setParent(CommandStream *parentCmdStream) - { - _parentCommandStream = parentCmdStream; - _state = parentCmdStream->_state; + void setParent(CommandStream* parentCmdStream) { + _parentCommandStream = parentCmdStream; + _state = parentCmdStream->_state; }; - CommandStream * getParent() { return _parentCommandStream; }; + CommandStream* getParent() { return _parentCommandStream; }; void setStream(int streamIndex); - CommandStreamState &getState() { return _state; }; + CommandStreamState& getState() { return _state; }; -private: - static void tokenize(const std::string &s, char delim, std::vector &tokens); + private: + static void tokenize(const std::string& s, char delim, std::vector& tokens); void parse(const std::string fullCmd); -protected: - CommandStreamState _state; -private: - + protected: + CommandStreamState _state; + private: // List of commands to run in this stream: - std::vector _commands; - + std::vector _commands; // Number of iterations to run the command loop - int _iterations; - - + int _iterations; // Us to run the the command-stream. Only valid after run is called. - long long _startTime; - double _elapsedUs; + long long _startTime; + double _elapsedUs; // Track nested loop of command streams: - CommandStream *_parentCommandStream; + CommandStream* _parentCommandStream; // Track if we are parsing commands in the subblock. - bool _parseInSubBlock; - + bool _parseInSubBlock; }; //================================================================================================= class Command { -public: - + public: // @p minArgs : Minimum arguments for command. -1 = don't check. - // @p maxArgs : Minimum arguments for command. 0 means min=max, ie exact #arguments expected. -1 = don't check max. - Command(CommandStream *cmdStream, const std::vector &args, int minArgs=0, int maxArgs=0) - : _commandStream(cmdStream), - _args(args) - { + // @p maxArgs : Minimum arguments for command. 0 means min=max, ie exact #arguments expected. + // -1 = don't check max. + Command(CommandStream* cmdStream, const std::vector& args, int minArgs = 0, + int maxArgs = 0) + : _commandStream(cmdStream), _args(args) { int numArgs = args.size() - 1; - if ((minArgs != -1 ) && (numArgs < minArgs)) { + if ((minArgs != -1) && (numArgs < minArgs)) { // TODO - print full command here. - failed ("Not enough arguments for command %s. (Expected %d, got %d)", args[0].c_str(), minArgs, numArgs); + failed("Not enough arguments for command %s. (Expected %d, got %d)", args[0].c_str(), + minArgs, numArgs); } // Check for an exact number of arguments: if (maxArgs == 0) { maxArgs = minArgs; } - if ((maxArgs != -1 ) && (numArgs > maxArgs)) { - failed ("Too many arguments for command %s. (Expected %d, got %d)", args[0].c_str(), maxArgs, numArgs); + if ((maxArgs != -1) && (numArgs > maxArgs)) { + failed("Too many arguments for command %s. (Expected %d, got %d)", args[0].c_str(), + maxArgs, numArgs); } }; - void printBrief(std::ostream &s=std::cout) const - { - s << _args[0]; - } + void printBrief(std::ostream& s = std::cout) const { s << _args[0]; } - virtual ~Command() {}; + virtual ~Command(){}; - virtual void print(const std::string &indent = "") const { + virtual void print(const std::string& indent = "") const { std::cout << indent << "["; - std::for_each(_args.begin(), _args.end(), [] (const std::string &s) { - std::cout << s; - }); + std::for_each(_args.begin(), _args.end(), [](const std::string& s) { std::cout << s; }); std::cout << "]"; }; virtual void run() = 0; -protected: - int readIntArg(int argIndex, const std::string &argName) - { + protected: + int readIntArg(int argIndex, const std::string& argName) { // TODO - catch references to non-existant arguments here. int argVal; try { argVal = std::stoi(_args[argIndex]); } catch (std::invalid_argument) { - failed ("Command %s has bad %s argument ('%s')", _args[0].c_str(), argName.c_str(), _args[argIndex].c_str()); + failed("Command %s has bad %s argument ('%s')", _args[0].c_str(), argName.c_str(), + _args[argIndex].c_str()); } return argVal; } -protected: - CommandStream *_commandStream; - std::vector _args; + + protected: + CommandStream* _commandStream; + std::vector _args; }; @@ -307,33 +287,30 @@ protected: #ifdef __HIP_PLATFORM_HCC__ //================================================================================================= // Use Aql to launch the NULL kernel. -class AqlKernelCommand : public Command -{ -public: - AqlKernelCommand(CommandStream *cmdStream, const std::vector args) : - Command(cmdStream, args) - { - hc::accelerator_view *av; +class AqlKernelCommand : public Command { + public: + AqlKernelCommand(CommandStream* cmdStream, const std::vector args) + : Command(cmdStream, args) { + hc::accelerator_view* av; HIPCHECK(hipHccGetAcceleratorView(cmdStream->currentStream(), &av)); hc::accelerator acc = av->get_accelerator(); hsa_region_t systemRegion = *(hsa_region_t*)acc.get_hsa_am_system_region(); - _hsaAgent = *(hsa_agent_t*) acc.get_hsa_agent(); + _hsaAgent = *(hsa_agent_t*)acc.get_hsa_agent(); std::ifstream file(FILENAME, std::ios::binary | std::ios::ate); std::streamsize fsize = file.tellg(); file.seekg(0, std::ios::beg); std::vector buffer(fsize); - if (file.read(buffer.data(), fsize)) - { + if (file.read(buffer.data(), fsize)) { uint64_t elfSize = ElfSize(&buffer[0]); assert(fsize == elfSize); - //TODO - replace module load code with explicit module load and unload. + // TODO - replace module load code with explicit module load and unload. hipModule_t module; HIPCHECK(hipModuleLoadData(&module, &buffer[0])); @@ -344,56 +321,53 @@ public: } }; - ~AqlKernelCommand() {}; + ~AqlKernelCommand(){}; void run() override { #define LEN 64 - uint32_t len = LEN; - uint32_t one = 1; + uint32_t len = LEN; + uint32_t one = 1; - float *Ad = NULL; + float* Ad = NULL; size_t argSize = 36; char argBuffer[argSize]; - *(uint32_t*) (&argBuffer[0]) = len; - *(uint32_t*) (&argBuffer[4]) = one; - *(uint32_t*) (&argBuffer[8]) = one; - *(uint32_t*) (&argBuffer[12]) = len; - *(uint32_t*) (&argBuffer[16]) = one; - *(uint32_t*) (&argBuffer[20]) = one; - *(float**) (&argBuffer[24]) = Ad; // Ad pointer argument + *(uint32_t*)(&argBuffer[0]) = len; + *(uint32_t*)(&argBuffer[4]) = one; + *(uint32_t*)(&argBuffer[8]) = one; + *(uint32_t*)(&argBuffer[12]) = len; + *(uint32_t*)(&argBuffer[16]) = one; + *(uint32_t*)(&argBuffer[20]) = one; + *(float**)(&argBuffer[24]) = Ad; // Ad pointer argument - void *config[] = { - HIP_LAUNCH_PARAM_BUFFER_POINTER, &argBuffer[0], - HIP_LAUNCH_PARAM_BUFFER_SIZE, &argSize, - HIP_LAUNCH_PARAM_END - }; + void* config[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &argBuffer[0], + HIP_LAUNCH_PARAM_BUFFER_SIZE, &argSize, HIP_LAUNCH_PARAM_END}; - hipModuleLaunchKernel(_function, len, 1, 1, LEN, 1, 1, 0, 0, NULL, (void**)&config); + hipModuleLaunchKernel(_function, len, 1, 1, LEN, 1, 1, 0, 0, NULL, (void**)&config); }; -public: - hsa_queue_t _hsaQueue; - hsa_agent_t _hsaAgent; + public: + hsa_queue_t _hsaQueue; + hsa_agent_t _hsaAgent; hipFunction_t _function; -private: - static uint64_t ElfSize(const void *emi){ - const Elf64_Ehdr *ehdr = (const Elf64_Ehdr*)emi; - const Elf64_Shdr *shdr = (const Elf64_Shdr*)((char*)emi + ehdr->e_shoff); + private: + static uint64_t ElfSize(const void* emi) { + const Elf64_Ehdr* ehdr = (const Elf64_Ehdr*)emi; + const Elf64_Shdr* shdr = (const Elf64_Shdr*)((char*)emi + ehdr->e_shoff); uint64_t max_offset = ehdr->e_shoff; uint64_t total_size = max_offset + ehdr->e_shentsize * ehdr->e_shnum; - for(uint16_t i=0;i < ehdr->e_shnum;++i){ + for (uint16_t i = 0; i < ehdr->e_shnum; ++i) { uint64_t cur_offset = static_cast(shdr[i].sh_offset); - if(max_offset < cur_offset){ + if (max_offset < cur_offset) { max_offset = cur_offset; total_size = max_offset; - if(SHT_NOBITS != shdr[i].sh_type){ + if (SHT_NOBITS != shdr[i].sh_type) { total_size += static_cast(shdr[i].sh_size); } } @@ -405,122 +379,110 @@ private: //================================================================================================= // HCC optimizes away fully NULL kernel calls, so run one that is nearly null: -class ModuleKernelCommand : public Command -{ -public: - ModuleKernelCommand(CommandStream *cmdStream, const std::vector args) : - Command(cmdStream, args), - _stream (cmdStream->currentStream()) { - - hipModule_t module; - HIPCHECK(hipModuleLoad(&module, FILENAME)); - HIPCHECK(hipModuleGetFunction(&_function, module, KERNEL_NAME)); - }; - ~ModuleKernelCommand() {}; +class ModuleKernelCommand : public Command { + public: + ModuleKernelCommand(CommandStream* cmdStream, const std::vector args) + : Command(cmdStream, args), _stream(cmdStream->currentStream()) { + hipModule_t module; + HIPCHECK(hipModuleLoad(&module, FILENAME)); + HIPCHECK(hipModuleGetFunction(&_function, module, KERNEL_NAME)); + }; + ~ModuleKernelCommand(){}; void run() override { #define LEN 64 - uint32_t len = LEN; - uint32_t one = 1; + uint32_t len = LEN; + uint32_t one = 1; - float *Ad = NULL; + float* Ad = NULL; size_t argSize = 36; char argBuffer[argSize]; - *(uint32_t*) (&argBuffer[0]) = len; - *(uint32_t*) (&argBuffer[4]) = one; - *(uint32_t*) (&argBuffer[8]) = one; - *(uint32_t*) (&argBuffer[12]) = len; - *(uint32_t*) (&argBuffer[16]) = one; - *(uint32_t*) (&argBuffer[20]) = one; - *(float**) (&argBuffer[24]) = Ad; // Ad pointer argument + *(uint32_t*)(&argBuffer[0]) = len; + *(uint32_t*)(&argBuffer[4]) = one; + *(uint32_t*)(&argBuffer[8]) = one; + *(uint32_t*)(&argBuffer[12]) = len; + *(uint32_t*)(&argBuffer[16]) = one; + *(uint32_t*)(&argBuffer[20]) = one; + *(float**)(&argBuffer[24]) = Ad; // Ad pointer argument - void *config[] = { - HIP_LAUNCH_PARAM_BUFFER_POINTER, &argBuffer[0], - HIP_LAUNCH_PARAM_BUFFER_SIZE, &argSize, - HIP_LAUNCH_PARAM_END - }; + void* config[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &argBuffer[0], + HIP_LAUNCH_PARAM_BUFFER_SIZE, &argSize, HIP_LAUNCH_PARAM_END}; - hipModuleLaunchKernel(_function, len, 1, 1, LEN, 1, 1, 0, 0, NULL, (void**)&config); + hipModuleLaunchKernel(_function, len, 1, 1, LEN, 1, 1, 0, 0, NULL, (void**)&config); }; -public: + public: hipFunction_t _function; hipStream_t _stream; }; -class KernelCommand : public Command -{ -public: - enum Type {Null, VectorAdd}; - KernelCommand(CommandStream *cmdStream, const std::vector args, Type kind) : - Command(cmdStream, args), - _kind(kind), - _stream (cmdStream->currentStream()) { - }; - ~KernelCommand() {}; +class KernelCommand : public Command { + public: + enum Type { Null, VectorAdd }; + KernelCommand(CommandStream* cmdStream, const std::vector args, Type kind) + : Command(cmdStream, args), _kind(kind), _stream(cmdStream->currentStream()){}; + ~KernelCommand(){}; void run() override { - static const int gridX = 64; + static const int gridX = 64; static const int groupX = 64; switch (_kind) { case Null: - hipLaunchKernel(NullKernel, dim3(gridX/groupX), dim3(gridX), 0, _stream, nullptr); + hipLaunchKernel(NullKernel, dim3(gridX / groupX), dim3(gridX), 0, _stream, nullptr); break; case VectorAdd: - assert(0); // TODO + assert(0); // TODO break; }; } -private: - Type _kind; + + private: + Type _kind; hipStream_t _stream; }; #ifdef __HIP_PLATFORM_HCC__ //================================================================================================= -class PfeCommand : public Command -{ -public: - PfeCommand(CommandStream *cmdStream, const std::vector args, hipStream_t stream = 0) : - Command(cmdStream, args) - { +class PfeCommand : public Command { + public: + PfeCommand(CommandStream* cmdStream, const std::vector args, + hipStream_t stream = 0) + : Command(cmdStream, args) { HIPCHECK(hipHccGetAcceleratorView(stream, &_av)); } - ~PfeCommand() { } + ~PfeCommand() {} void run() override { - static const int gridX = 64; + static const int gridX = 64; static const int groupX = 64; auto cf = hc::parallel_for_each(*_av, hc::extent<1>(gridX).tile(groupX), - [=](hc::index<1>& idx) __HC__ { - }); + [=](hc::index<1>& idx) __HC__ {}); } -private: - hc::accelerator_view *_av; + + private: + hc::accelerator_view* _av; }; #endif - //================================================================================================= -class CopyCommand : public Command -{ -enum MemType {PinnedHost, UnpinnedHost, Device} ; +class CopyCommand : public Command { + enum MemType { PinnedHost, UnpinnedHost, Device }; -public: - CopyCommand(CommandStream *cmdStream, const std::vector &args, hipMemcpyKind kind, bool isAsync, bool isPinnedHost) ; + public: + CopyCommand(CommandStream* cmdStream, const std::vector& args, hipMemcpyKind kind, + bool isAsync, bool isPinnedHost); - ~CopyCommand() - { + ~CopyCommand() { if (_dst) { dealloc(_dst, _dstType); _dst = NULL; @@ -541,9 +503,9 @@ public: } }; -private: - void * alloc(size_t size, MemType memType) { - void * p; + private: + void* alloc(size_t size, MemType memType) { + void* p; if (memType == Device) { HIPCHECK(hipMalloc(&p, size)); @@ -562,7 +524,7 @@ private: }; - void dealloc(void *p, MemType memType) { + void dealloc(void* p, MemType memType) { if (memType == Device) { HIPCHECK(hipFree(p)); } else if (memType == PinnedHost) { @@ -575,53 +537,42 @@ private: } -private: - bool _isAsync; - hipStream_t _stream; + private: + bool _isAsync; + hipStream_t _stream; hipMemcpyKind _kind; - size_t _sizeBytes; - void *_dst; + size_t _sizeBytes; + void* _dst; MemType _dstType; - void *_src; + void* _src; MemType _srcType; }; //================================================================================================= -class DeviceSyncCommand : public Command -{ -public: - DeviceSyncCommand(CommandStream *cmdStream, const std::vector &args) : - Command(cmdStream, args) {}; +class DeviceSyncCommand : public Command { + public: + DeviceSyncCommand(CommandStream* cmdStream, const std::vector& args) + : Command(cmdStream, args){}; - void run() override { - HIPCHECK(hipDeviceSynchronize()); - }; + void run() override { HIPCHECK(hipDeviceSynchronize()); }; }; //================================================================================================= -class StreamSyncCommand : public Command -{ -public: - StreamSyncCommand(CommandStream *cmdStream, const std::vector &args) : - Command(cmdStream, args), - _stream(cmdStream->currentStream()) - {}; +class StreamSyncCommand : public Command { + public: + StreamSyncCommand(CommandStream* cmdStream, const std::vector& args) + : Command(cmdStream, args), _stream(cmdStream->currentStream()){}; - const char *help() { - return "synchronizes the current stream"; - }; + const char* help() { return "synchronizes the current stream"; }; + void run() override { HIPCHECK(hipStreamSynchronize(_stream)); }; - void run() override { - HIPCHECK(hipStreamSynchronize(_stream)); - }; - -private: + private: hipStream_t _stream; }; @@ -629,53 +580,45 @@ private: //================================================================================================= //================================================================================================= -class LoopCommand : public Command -{ -public: - LoopCommand(CommandStream *parentCmdStream, const std::vector &args) : - Command(parentCmdStream, args, 1) - { +class LoopCommand : public Command { + public: + LoopCommand(CommandStream* parentCmdStream, const std::vector& args) + : Command(parentCmdStream, args, 1) { int loopCnt; try { loopCnt = std::stoi(args[1]); } catch (std::invalid_argument) { - failed ("bad LOOP_CNT=%s", args[1].c_str()); + failed("bad LOOP_CNT=%s", args[1].c_str()); } _commandStream = new CommandStream("", loopCnt); _commandStream->setParent(parentCmdStream); parentCmdStream->enterSubBlock(_commandStream); - }; - void print(const std::string &indent = "") const override { + void print(const std::string& indent = "") const override { Command::print(); - _commandStream->print (indent + " "); + _commandStream->print(indent + " "); }; - void run() override { - _commandStream->run(); - }; + void run() override { _commandStream->run(); }; }; //================================================================================================= -class EndBlockCommand : public Command -{ -public: - EndBlockCommand(CommandStream *blockCmdStream, CommandStream *parentCmdStream, const std::vector &args) : - Command(parentCmdStream, args, 0, 1), - _blockCmdStream(blockCmdStream), - _printTiming(0) - { - int argCnt = args.size()-1; - if (argCnt >= 1 ) { +class EndBlockCommand : public Command { + public: + EndBlockCommand(CommandStream* blockCmdStream, CommandStream* parentCmdStream, + const std::vector& args) + : Command(parentCmdStream, args, 0, 1), _blockCmdStream(blockCmdStream), _printTiming(0) { + int argCnt = args.size() - 1; + if (argCnt >= 1) { _printTiming = readIntArg(1, "PRINT_TIMING"); } if (parentCmdStream == nullptr) { - failed ("%s without corresponding command to start block", args[0].c_str()); + failed("%s without corresponding command to start block", args[0].c_str()); } parentCmdStream->exitSubBlock(); }; @@ -684,11 +627,10 @@ public: if (_printTiming) { _blockCmdStream->printTiming(); } - }; -private: - CommandStream *_blockCmdStream; + private: + CommandStream* _blockCmdStream; // print the stream when loop exits. int _printTiming; @@ -696,69 +638,60 @@ private: //================================================================================================= -class SetStreamCommand : public Command -{ -public: - SetStreamCommand(CommandStream *cmdStream, const std::vector &args) : - Command(cmdStream, args, 1) - { +class SetStreamCommand : public Command { + public: + SetStreamCommand(CommandStream* cmdStream, const std::vector& args) + : Command(cmdStream, args, 1) { int streamIndex = readIntArg(1, "STREAM_INDEX"); cmdStream->setStream(streamIndex); - }; - void run() override { - }; + void run() override{}; }; //================================================================================================= -class PrintTimingCommand : public Command -{ -public: - PrintTimingCommand(CommandStream *cmdStream, const std::vector &args) - : Command(cmdStream, args, 1) - { +class PrintTimingCommand : public Command { + public: + PrintTimingCommand(CommandStream* cmdStream, const std::vector& args) + : Command(cmdStream, args, 1) { _iterations = readIntArg(1, "ITERATIONS"); }; - void run() override { - _commandStream->printTiming(_iterations); - }; + void run() override { _commandStream->printTiming(_iterations); }; -private: - int _iterations; + private: + int _iterations; }; //================================================================================================= -CopyCommand::CopyCommand(CommandStream *cmdStream, const std::vector &args, - hipMemcpyKind kind, bool isAsync, bool isPinnedHost) : - Command(cmdStream, args) , - _isAsync(isAsync), - _kind(kind), - _stream(cmdStream->currentStream()) - { - switch (kind) { - case hipMemcpyDeviceToHost: - _srcType = Device; - _dstType = isPinnedHost ? PinnedHost : UnpinnedHost; - break; - case hipMemcpyHostToDevice: - _srcType = isPinnedHost ? PinnedHost : UnpinnedHost; - _dstType = Device; - break; - default: - HIPASSERT(0, "Unknown hipMemcpyKind"); - }; - - _sizeBytes = 64; //TODO, support reading from arg. - - _dst = alloc(_sizeBytes, _dstType); - _src = alloc(_sizeBytes, _srcType); +CopyCommand::CopyCommand(CommandStream* cmdStream, const std::vector& args, + hipMemcpyKind kind, bool isAsync, bool isPinnedHost) + : Command(cmdStream, args), + _isAsync(isAsync), + _kind(kind), + _stream(cmdStream->currentStream()) { + switch (kind) { + case hipMemcpyDeviceToHost: + _srcType = Device; + _dstType = isPinnedHost ? PinnedHost : UnpinnedHost; + break; + case hipMemcpyHostToDevice: + _srcType = isPinnedHost ? PinnedHost : UnpinnedHost; + _dstType = Device; + break; + default: + HIPASSERT(0, "Unknown hipMemcpyKind"); }; + _sizeBytes = 64; // TODO, support reading from arg. + + _dst = alloc(_sizeBytes, _dstType); + _src = alloc(_sizeBytes, _srcType); +}; + //================================================================================================= //================================================================================================= @@ -771,41 +704,31 @@ CommandStream::CommandStream(std::string commandStreamString, int iterations) _startTime(0), _elapsedUs(0.0), _parentCommandStream(nullptr), - _parseInSubBlock(false) -{ + _parseInSubBlock(false) { std::vector tokens; tokenize(commandStreamString, ';', tokens); - std::for_each(tokens.begin(), tokens.end(), [&] (const std::string s) { - this->parse(s); - }); + std::for_each(tokens.begin(), tokens.end(), [&](const std::string s) { this->parse(s); }); setStream(0); } -CommandStream::~CommandStream() -{ - std::for_each(_state._streams.begin(), _state._streams.end(), [&] (hipStream_t s) { +CommandStream::~CommandStream() { + std::for_each(_state._streams.begin(), _state._streams.end(), [&](hipStream_t s) { if (s) { HIPCHECK(hipStreamDestroy(s)); } }); - std::for_each(_commands.begin(), _commands.end(), [&] (Command *c) { - delete c; - }); - - + std::for_each(_commands.begin(), _commands.end(), [&](Command* c) { delete c; }); } -void CommandStream::setStream(int streamIndex) -{ - +void CommandStream::setStream(int streamIndex) { if (streamIndex >= _state._streams.size()) { - _state._streams.resize(streamIndex+1); + _state._streams.resize(streamIndex + 1); } if (streamIndex && (_state._streams[streamIndex] == nullptr)) { @@ -816,51 +739,45 @@ void CommandStream::setStream(int streamIndex) _state._currentStream = stream; } else { // Use existing stream: - + _state._currentStream = _state._streams[streamIndex]; } - } -void CommandStream::tokenize(const std::string &s, char delim, std::vector &tokens) -{ +void CommandStream::tokenize(const std::string& s, char delim, std::vector& tokens) { std::stringstream ss; ss.str(s); std::string item; while (getline(ss, item, delim)) { - item.erase (std::remove (item.begin(), item.end(), ' '), item.end()); // remove whitespace. + item.erase(std::remove(item.begin(), item.end(), ' '), item.end()); // remove whitespace. tokens.push_back(item); } } -void trim(std::string *s) -{ +void trim(std::string* s) { // trim whitespace from begin and end: - const char *t = "\t\n\r\f\v"; + const char* t = "\t\n\r\f\v"; s->erase(0, s->find_first_not_of(t)); - s->erase(s->find_last_not_of(t)+1); + s->erase(s->find_last_not_of(t) + 1); } -void ltrim(std::string *s) -{ +void ltrim(std::string* s) { // trim whitespace from begin and end: - const char *t = "\t\n\r\f\v"; + const char* t = "\t\n\r\f\v"; s->erase(0, s->find_first_not_of(t)); } -void CommandStream::parse(std::string fullCmd) -{ - //convert to lower-case: +void CommandStream::parse(std::string fullCmd) { + // convert to lower-case: std::transform(fullCmd.begin(), fullCmd.end(), fullCmd.begin(), ::tolower); trim(&fullCmd); if (p_db) { - printf ("parse: <%s>\n", fullCmd.c_str()); + printf("parse: <%s>\n", fullCmd.c_str()); } - std::string c; std::vector args; size_t leftParenZ = fullCmd.find_first_of('('); @@ -871,40 +788,38 @@ void CommandStream::parse(std::string fullCmd) c = fullCmd.substr(0, leftParenZ); args.push_back(c); size_t rightParenZ = fullCmd.find_first_of(')', leftParenZ); - std::string argStr = fullCmd.substr(leftParenZ+1, rightParenZ-leftParenZ-1); - //printf ("c=%s argstr='%s' leftParenZ=%zu rightParenZ=%zu\n", c.c_str(), argStr.c_str(), leftParenZ, rightParenZ); + std::string argStr = fullCmd.substr(leftParenZ + 1, rightParenZ - leftParenZ - 1); + // printf ("c=%s argstr='%s' leftParenZ=%zu rightParenZ=%zu\n", c.c_str(), argStr.c_str(), + // leftParenZ, rightParenZ); tokenize(argStr, ',', args); - } - - - - if ((args.size()==0) || (fullCmd.c_str()[0] == '#') ) { + if ((args.size() == 0) || (fullCmd.c_str()[0] == '#')) { if (p_db) { - printf (" skip comment\n"); + printf(" skip comment\n"); } return; - } + } + Command* cmd = NULL; + CommandStream* cmdStream = currentCommandStream(); - Command *cmd = NULL; - CommandStream *cmdStream = currentCommandStream(); - if (c == "h2d") { - cmd = new CopyCommand(cmdStream, args, hipMemcpyHostToDevice, true/*isAsync*/, true/*isPinned*/); + cmd = new CopyCommand(cmdStream, args, hipMemcpyHostToDevice, true /*isAsync*/, + true /*isPinned*/); //= h2d //= Performs an async host-to-device copy of array A_h to A_d. //= The size of these arrays may be set with the datasize command. } else if (c == "d2h") { - cmd = new CopyCommand(cmdStream, args, hipMemcpyDeviceToHost, true/*isAsync*/, true/*isPinned*/); + cmd = new CopyCommand(cmdStream, args, hipMemcpyDeviceToHost, true /*isAsync*/, + true /*isPinned*/); //= d2h //= Performs an async device-to-host copy of array A_d to A_h. //= The size of these arrays may be set with the datasize command. - + } else if (c == "modulekernel") { cmd = new ModuleKernelCommand(cmdStream, args); @@ -929,20 +844,21 @@ void CommandStream::parse(std::string fullCmd) } else if (c == "streamsync") { //= streamsync - //= Execute hipStreamSynchronize. + //= Execute hipStreamSynchronize. //= This will cause the host thread to wait until the current stream //= completes all pending operations. cmd = new StreamSyncCommand(cmdStream, args); } else if (c == "setstream") { //= setstream(STREAM_INDEX); - //= Set current stream used by subsequent commands. - //= STREAM_INDEX is index starting from 0...N. - //= This function will create new stream on first call to setstream or re-use previous + //= Set current stream used by subsequent commands. + //= STREAM_INDEX is index starting from 0...N. + //= This function will create new stream on first call to setstream or re-use previous //= stream if setstream has already been called with STREAM_INDEX. - //= STREAM_INDEX=0 will use the default "null" stream associated with the device, and will not create a new stream. - //= The default stream has special, conservative synchronization properties. - + //= STREAM_INDEX=0 will use the default "null" stream associated with the device, and will + //not create a new stream. = The default stream has special, conservative synchronization + //properties. + cmd = new SetStreamCommand(cmdStream, args); } else if (c == "printtiming") { @@ -952,15 +868,15 @@ void CommandStream::parse(std::string fullCmd) //= loop(LOOP_CNT) //= Loop over next set of commands (until 'endloop' command) for LOOP_CNT iterations. //= Loops can be nested. - + cmd = new LoopCommand(cmdStream, args); } else if (c == "endloop") { //= endloop - //= End a looped sequence. Must be paired with a preceding loop command. - //= Command between the `loop` and `endloop` must be executed - - CommandStream * parentCmdStream = cmdStream->getParent() ; + //= End a looped sequence. Must be paired with a preceding loop command. + //= Command between the `loop` and `endloop` must be executed + + CommandStream* parentCmdStream = cmdStream->getParent(); cmd = new EndBlockCommand(cmdStream, parentCmdStream, args); cmdStream = parentCmdStream; @@ -975,28 +891,23 @@ void CommandStream::parse(std::string fullCmd) } - - -void CommandStream::print(const std::string &indent) const -{ +void CommandStream::print(const std::string& indent) const { for (auto cmdI = _commands.begin(); cmdI != _commands.end(); cmdI++) { (*cmdI)->print(indent); }; } -void CommandStream::printBrief(std::ostream &s) const -{ +void CommandStream::printBrief(std::ostream& s) const { for (auto cmdI = _commands.begin(); cmdI != _commands.end(); cmdI++) { (*cmdI)->printBrief(s); s << ";"; }; } -void CommandStream::run() -{ +void CommandStream::run() { _startTime = get_time(); - for (int i=0; i<_iterations; i++) { + for (int i = 0; i < _iterations; i++) { for (auto cmdI = _commands.begin(); cmdI != _commands.end(); cmdI++) { if (p_verbose) { (*cmdI)->print(); @@ -1009,8 +920,7 @@ void CommandStream::run() recordTime(); }; -void CommandStream::recordTime() -{ +void CommandStream::recordTime() { if (_elapsedUs == 0.0) { auto stopTime = get_time(); _elapsedUs = stopTime - _startTime; @@ -1018,11 +928,9 @@ void CommandStream::recordTime() } -void CommandStream::printTiming(int iterations) -{ - - if ((_state._subBlocks.size() == 1) && (_commands.size()==1)) { - //printf ("print just the loop\n"); +void CommandStream::printTiming(int iterations) { + if ((_state._subBlocks.size() == 1) && (_commands.size() == 1)) { + // printf ("print just the loop\n"); _state._subBlocks.front()->printTiming(iterations); } else { g_printedTiming = true; @@ -1031,33 +939,31 @@ void CommandStream::printTiming(int iterations) if (iterations == 0) { iterations = _iterations; } - std::cout << "command<"; printBrief(std::cout); - std::cout << ">," ; - printf (" iterations,%d, total_time,%6.3f, time/iteration,%6.3f\n", iterations, _elapsedUs, _elapsedUs/iterations); + std::cout << "command<"; + printBrief(std::cout); + std::cout << ">,"; + printf(" iterations,%d, total_time,%6.3f, time/iteration,%6.3f\n", iterations, + _elapsedUs, _elapsedUs / iterations); } }; - - - //================================================================================================= -int main(int argc, char *argv[]) -{ +int main(int argc, char* argv[]) { parseStandardArguments(argc, argv); printConfig(); - CommandStream *cs; + CommandStream* cs; if (p_blockingSync) { #ifdef __HIP_PLATFORM_HCC__ - printf ("setting BlockingSync for AMD\n"); + printf("setting BlockingSync for AMD\n"); setenv("HIP_BLOCKING_SYNC", "1", 1); #endif #ifdef __HIP_PLATFORM_NVCC__ - printf ("setting cudaDeviceBlockingSync\n"); + printf("setting cudaDeviceBlockingSync\n"); HIPCHECK(hipSetDeviceFlags(cudaDeviceBlockingSync)); #endif }; @@ -1068,10 +974,9 @@ int main(int argc, char *argv[]) std::ifstream file(p_file); std::string str; std::string file_contents; - while (std::getline(file, str)) - { + while (std::getline(file, str)) { file_contents += str; - } + } cs = new CommandStream(file_contents, p_iterations); @@ -1080,7 +985,7 @@ int main(int argc, char *argv[]) } cs->print(); - printf ("------\n"); + printf("------\n"); cs->run(); if (!g_printedTiming) { @@ -1091,5 +996,4 @@ int main(int argc, char *argv[]) } - // TODO - add error checking for arguments. diff --git a/hipamd/samples/1_Utils/hipCommander/nullkernel.hip.cpp b/hipamd/samples/1_Utils/hipCommander/nullkernel.hip.cpp index 890e9bdc1e..410796c7e6 100644 --- a/hipamd/samples/1_Utils/hipCommander/nullkernel.hip.cpp +++ b/hipamd/samples/1_Utils/hipCommander/nullkernel.hip.cpp @@ -1,6 +1,6 @@ #include "hip/hip_runtime.h" -extern "C" __global__ void NullKernel(hipLaunchParm lp, float* Ad){ +extern "C" __global__ void NullKernel(hipLaunchParm lp, float* Ad) { if (Ad) { Ad[0] = 42; } diff --git a/hipamd/samples/1_Utils/hipCommander/testcase.cpp b/hipamd/samples/1_Utils/hipCommander/testcase.cpp index 0eeae7c50f..93ebcf40c1 100644 --- a/hipamd/samples/1_Utils/hipCommander/testcase.cpp +++ b/hipamd/samples/1_Utils/hipCommander/testcase.cpp @@ -1,20 +1,17 @@ #include -static const int BLOCKSIZEX=32; -static const int BLOCKSIZEY=16; +static const int BLOCKSIZEX = 32; +static const int BLOCKSIZEY = 16; -__global__ void fails(hipLaunchParm lp, float* pErrorI) -{ - if(pErrorI!=0) - { - pErrorI[0]=1; +__global__ void fails(hipLaunchParm lp, float* pErrorI) { + if (pErrorI != 0) { + pErrorI[0] = 1; } } -int main() -{ - dim3 blocks(1,1); - dim3 threads(BLOCKSIZEX,BLOCKSIZEY); +int main() { + dim3 blocks(1, 1); + dim3 threads(BLOCKSIZEX, BLOCKSIZEY); float error; hipLaunchKernel(HIP_KERNEL_NAME(fails), blocks, threads, 0, 0, &error); diff --git a/hipamd/samples/1_Utils/hipDispatchLatency/ResultDatabase.cpp b/hipamd/samples/1_Utils/hipDispatchLatency/ResultDatabase.cpp index f6f2fab709..b769ca4b32 100644 --- a/hipamd/samples/1_Utils/hipDispatchLatency/ResultDatabase.cpp +++ b/hipamd/samples/1_Utils/hipDispatchLatency/ResultDatabase.cpp @@ -11,96 +11,72 @@ using namespace std; #define SORT_RETAIN_ATTS_ORDER 1 -bool ResultDatabase::Result::operator<(const Result &rhs) const -{ - if (test < rhs.test) - return true; - if (test > rhs.test) - return false; -#if (SORT_RETAIN_ATTS_ORDER == 0) +bool ResultDatabase::Result::operator<(const Result& rhs) const { + if (test < rhs.test) return true; + if (test > rhs.test) return false; +#if (SORT_RETAIN_ATTS_ORDER == 0) // For ties, sort by the value of the attribute: - if (atts < rhs.atts) - return true; - if (atts > rhs.atts) - return false; + if (atts < rhs.atts) return true; + if (atts > rhs.atts) return false; #endif - return false; // less-operator returns false on equal + return false; // less-operator returns false on equal } -double ResultDatabase::Result::GetMin() const -{ +double ResultDatabase::Result::GetMin() const { double r = FLT_MAX; - for (int i=0; i= 100) - return value[n-1]; + if (q <= 0) return value[0]; + if (q >= 100) return value[n - 1]; double index = ((n + 1.) * q / 100.) - 1; vector sorted = value; sort(sorted.begin(), sorted.end()); - if (n == 2) - return (sorted[0] * (1 - q/100.) + sorted[1] * (q/100.)); + if (n == 2) return (sorted[0] * (1 - q / 100.) + sorted[1] * (q / 100.)); int index_lo = int(index); double frac = index - index_lo; - if (frac == 0) - return sorted[index_lo]; + if (frac == 0) return sorted[index_lo]; double lo = sorted[index_lo]; double hi = sorted[index_lo + 1]; - return lo + (hi-lo)*frac; + return lo + (hi - lo) * frac; } -double ResultDatabase::Result::GetMean() const -{ +double ResultDatabase::Result::GetMean() const { double r = 0; - for (int i=0; i &values) -{ - for (int i=0; i& values) { + for (int i = 0; i < values.size(); i++) { AddResult(test, atts, unit, values[i]); } } -static string RemoveAllButLeadingSpaces(const string &a) -{ +static string RemoveAllButLeadingSpaces(const string& a) { string b; int n = a.length(); int i = 0; - while (i= results.size()) - { + if (index >= results.size()) { Result r; r.test = test; r.atts = atts; @@ -193,43 +153,35 @@ void ResultDatabase::AddResult(const string &test_orig, // Changed note about missing values to be worded a little better. // // **************************************************************************** -void ResultDatabase::DumpDetailed(ostream &out) -{ +void ResultDatabase::DumpDetailed(ostream& out) { vector sorted(results); #if SORT_BY_NAME stable_sort(sorted.begin(), sorted.end()); #endif - const int testNameW = 24 ; + const int testNameW = 24; const int attW = 12; const int fieldW = 11; out << std::fixed << right << std::setprecision(4); int maxtrials = 1; - for (int i=0; i maxtrials) - maxtrials = sorted[i].value.size(); + for (int i = 0; i < sorted.size(); i++) { + if (sorted[i].value.size() > maxtrials) maxtrials = sorted[i].value.size(); } // TODO: in big parallel runs, the "trials" are the procs // and we really don't want to print them all out.... - out << setw(testNameW) << "test\t" - << setw(attW) << "atts\t" - << setw(fieldW) - << "median\t" + out << setw(testNameW) << "test\t" << setw(attW) << "atts\t" << setw(fieldW) << "median\t" << "mean\t" << "stddev\t" << "min\t" << "max\t"; - for (int i=0; i sorted(results); #if SORT_BY_NAME stable_sort(sorted.begin(), sorted.end()); #endif - const int testNameW = 32 ; + const int testNameW = 32; const int attW = 12; const int fieldW = 9; out << std::fixed << right << std::setprecision(2); // TODO: in big parallel runs, the "trials" are the procs // and we really don't want to print them all out.... - out << setw(testNameW) << "test\t" - << setw(attW) << "atts\t" - << setw(fieldW) - << "units\t" + out << setw(testNameW) << "test\t" << setw(attW) << "atts\t" << setw(fieldW) << "units\t" << "median\t" << "mean\t" << "stddev\t" @@ -316,9 +263,8 @@ void ResultDatabase::DumpSummary(ostream &out) << "max\t"; out << endl; - for (int i=0; i sorted(results); @@ -398,32 +340,30 @@ void ResultDatabase::DumpCsv(string fileName) stable_sort(sorted.begin(), sorted.end()); #endif - //Check to see if the file is empty - if so, add the headers + // Check to see if the file is empty - if so, add the headers emptyFile = this->IsFileEmpty(fileName); - //Open file and append by default + // Open file and append by default ofstream out; - out.open(fileName.c_str(), std::ofstream::out | std::ofstream::app); + out.open(fileName.c_str(), std::ofstream::out | std::ofstream::app); - //Add headers only for empty files - if(emptyFile) - { - // TODO: in big parallel runs, the "trials" are the procs - // and we really don't want to print them all out.... - out << "test, " - << "atts, " - << "units, " - << "median, " - << "mean, " - << "stddev, " - << "min, " - << "max, "; - out << endl; + // Add headers only for empty files + if (emptyFile) { + // TODO: in big parallel runs, the "trials" are the procs + // and we really don't want to print them all out.... + out << "test, " + << "atts, " + << "units, " + << "median, " + << "mean, " + << "stddev, " + << "min, " + << "max, "; + out << endl; } - for (int i=0; i -ResultDatabase::GetResultsForTest(const string &test) -{ +vector ResultDatabase::GetResultsForTest(const string& test) { // get only the given test results vector retval; - for (int i=0; i & -ResultDatabase::GetResults() const -{ - return results; -} +const vector& ResultDatabase::GetResults() const { return results; } diff --git a/hipamd/samples/1_Utils/hipDispatchLatency/ResultDatabase.h b/hipamd/samples/1_Utils/hipDispatchLatency/ResultDatabase.h index 4b63a02a1f..ca6a00fc91 100644 --- a/hipamd/samples/1_Utils/hipDispatchLatency/ResultDatabase.h +++ b/hipamd/samples/1_Utils/hipDispatchLatency/ResultDatabase.h @@ -6,11 +6,11 @@ #include #include #include +using std::ifstream; +using std::ofstream; +using std::ostream; using std::string; using std::vector; -using std::ostream; -using std::ofstream; -using std::ifstream; // **************************************************************************** @@ -40,18 +40,16 @@ using std::ifstream; // Added a GetResults method as well, and made several functions const. // // **************************************************************************** -class ResultDatabase -{ - public: +class ResultDatabase { + public: // // A performance result for a single SHOC benchmark run. // - struct Result - { - string test; // e.g. "readback" - string atts; // e.g. "pagelocked 4k^2" - string unit; // e.g. "MB/sec" - vector value; // e.g. "837.14" + struct Result { + string test; // e.g. "readback" + string atts; // e.g. "pagelocked 4k^2" + string unit; // e.g. "MB/sec" + vector value; // e.g. "837.14" double GetMin() const; double GetMax() const; double GetMedian() const; @@ -59,41 +57,32 @@ class ResultDatabase double GetMean() const; double GetStdDev() const; - bool operator<(const Result &rhs) const; + bool operator<(const Result& rhs) const; - bool HadAnyFLTMAXValues() const - { - for (int i=0; i= FLT_MAX) - return true; + bool HadAnyFLTMAXValues() const { + for (int i = 0; i < value.size(); ++i) { + if (value[i] >= FLT_MAX) return true; } return false; } }; - protected: + protected: vector results; - public: - void AddResult(const string &test, - const string &atts, - const string &unit, - double value); - void AddResults(const string &test, - const string &atts, - const string &unit, - const vector &values); - vector GetResultsForTest(const string &test); - const vector &GetResults() const; + public: + void AddResult(const string& test, const string& atts, const string& unit, double value); + void AddResults(const string& test, const string& atts, const string& unit, + const vector& values); + vector GetResultsForTest(const string& test); + const vector& GetResults() const; void ClearAllResults(); void DumpDetailed(ostream&); void DumpSummary(ostream&); void DumpCsv(string fileName); - private: + private: bool IsFileEmpty(string fileName); - }; diff --git a/hipamd/samples/1_Utils/hipDispatchLatency/hipDispatchLatency.cpp b/hipamd/samples/1_Utils/hipDispatchLatency/hipDispatchLatency.cpp index 2a4f6ff649..7aa8fa4992 100644 --- a/hipamd/samples/1_Utils/hipDispatchLatency/hipDispatchLatency.cpp +++ b/hipamd/samples/1_Utils/hipDispatchLatency/hipDispatchLatency.cpp @@ -21,35 +21,34 @@ THE SOFTWARE. */ #include "hip/hip_runtime.h" -#include -#include -#include"ResultDatabase.h" +#include +#include +#include "ResultDatabase.h" #define PRINT_PROGRESS 0 -#define check(cmd) \ -{\ - hipError_t status = cmd;\ - if(status != hipSuccess){ \ - printf("error: '%s'(%d) from %s at %s:%d\n", \ - hipGetErrorString(status), status, #cmd,\ - __FILE__, __LINE__); \ - abort(); \ - }\ -} +#define check(cmd) \ + { \ + hipError_t status = cmd; \ + if (status != hipSuccess) { \ + printf("error: '%s'(%d) from %s at %s:%d\n", hipGetErrorString(status), status, #cmd, \ + __FILE__, __LINE__); \ + abort(); \ + } \ + } -#define LEN 1024*1024 +#define LEN 1024 * 1024 #define NUM_GROUPS 1 #define GROUP_SIZE 64 -#define TEST_ITERS 20 +#define TEST_ITERS 20 #define DISPATCHES_PER_TEST 100 const unsigned p_tests = 0xfffffff; // HCC optimizes away fully NULL kernel calls, so run one that is nearly null: -__global__ void NearlyNull(hipLaunchParm lp, float* Ad){ +__global__ void NearlyNull(hipLaunchParm lp, float* Ad) { if (Ad) { Ad[0] = 42; } @@ -59,38 +58,35 @@ __global__ void NearlyNull(hipLaunchParm lp, float* Ad){ ResultDatabase resultDB; -void stopTest(hipEvent_t start, hipEvent_t stop, const char *msg, int iters) -{ - float mS = 0; +void stopTest(hipEvent_t start, hipEvent_t stop, const char* msg, int iters) { + float mS = 0; check(hipEventRecord(stop)); check(hipDeviceSynchronize()); check(hipEventElapsedTime(&mS, start, stop)); - resultDB.AddResult(std::string(msg), "", "uS", mS*1000/iters); - if (PRINT_PROGRESS & 0x1 ) { - std::cout<< msg <<"\t\t"< #include "hip/hip_runtime.h" -#define KNRM "\x1B[0m" -#define KRED "\x1B[31m" -#define KGRN "\x1B[32m" -#define KYEL "\x1B[33m" -#define KBLU "\x1B[34m" -#define KMAG "\x1B[35m" -#define KCYN "\x1B[36m" -#define KWHT "\x1B[37m" +#define KNRM "\x1B[0m" +#define KRED "\x1B[31m" +#define KGRN "\x1B[32m" +#define KYEL "\x1B[33m" +#define KBLU "\x1B[34m" +#define KMAG "\x1B[35m" +#define KCYN "\x1B[36m" +#define KWHT "\x1B[37m" -#define failed(...) \ - printf ("%serror: ", KRED);\ - printf (__VA_ARGS__);\ - printf ("\n");\ - printf ("error: TEST FAILED\n%s", KNRM );\ +#define failed(...) \ + printf("%serror: ", KRED); \ + printf(__VA_ARGS__); \ + printf("\n"); \ + printf("error: TEST FAILED\n%s", KNRM); \ exit(EXIT_FAILURE); -#define HIPCHECK(error) \ - if (error != hipSuccess) { \ - printf("%serror: '%s'(%d) at %s:%d%s\n", \ - KRED, hipGetErrorString(error), error,\ - __FILE__, __LINE__,KNRM);\ - failed("API returned error code.");\ +#define HIPCHECK(error) \ + if (error != hipSuccess) { \ + printf("%serror: '%s'(%d) at %s:%d%s\n", KRED, hipGetErrorString(error), error, __FILE__, \ + __LINE__, KNRM); \ + failed("API returned error code."); \ } -void printCompilerInfo () -{ +void printCompilerInfo() { #ifdef __HCC__ - printf ("compiler: hcc version=%s, workweek (YYWWD) = %u\n", __hcc_version__, __hcc_workweek__); + printf("compiler: hcc version=%s, workweek (YYWWD) = %u\n", __hcc_version__, __hcc_workweek__); #endif #ifdef __NVCC__ - printf ("compiler: nvcc\n"); + printf("compiler: nvcc\n"); #endif } -double bytesToGB(size_t s) -{ - return (double)s / (1024.0*1024.0*1024.0); -} +double bytesToGB(size_t s) { return (double)s / (1024.0 * 1024.0 * 1024.0); } -#define printLimit(w1, limit, units) \ -{\ - size_t val;\ - cudaDeviceGetLimit(&val, limit);\ - std::cout << setw(w1) << #limit": " << val << " " << units << std::endl;\ -} +#define printLimit(w1, limit, units) \ + { \ + size_t val; \ + cudaDeviceGetLimit(&val, limit); \ + std::cout << setw(w1) << #limit ": " << val << " " << units << std::endl; \ + } -void printDeviceProp (int deviceId) -{ +void printDeviceProp(int deviceId) { using namespace std; const int w1 = 34; cout << left; - cout << setw(w1) << "--------------------------------------------------------------------------------" << endl; + cout << setw(w1) + << "--------------------------------------------------------------------------------" + << endl; cout << setw(w1) << "device#" << deviceId << endl; hipDeviceProp_t props; @@ -88,16 +84,22 @@ void printDeviceProp (int deviceId) cout << setw(w1) << "pciBusID: " << props.pciBusID << endl; cout << setw(w1) << "pciDeviceID: " << props.pciDeviceID << endl; cout << setw(w1) << "multiProcessorCount: " << props.multiProcessorCount << endl; - cout << setw(w1) << "maxThreadsPerMultiProcessor: " << props.maxThreadsPerMultiProcessor << endl; + cout << setw(w1) << "maxThreadsPerMultiProcessor: " << props.maxThreadsPerMultiProcessor + << endl; cout << setw(w1) << "isMultiGpuBoard: " << props.isMultiGpuBoard << endl; cout << setw(w1) << "clockRate: " << (float)props.clockRate / 1000.0 << " Mhz" << endl; - cout << setw(w1) << "memoryClockRate: " << (float)props.memoryClockRate / 1000.0 << " Mhz" << endl; + cout << setw(w1) << "memoryClockRate: " << (float)props.memoryClockRate / 1000.0 << " Mhz" + << endl; cout << setw(w1) << "memoryBusWidth: " << props.memoryBusWidth << endl; - cout << setw(w1) << "clockInstructionRate: " << (float)props.clockInstructionRate / 1000.0 << " Mhz" << endl; - cout << setw(w1) << "totalGlobalMem: " << fixed << setprecision(2) << bytesToGB(props.totalGlobalMem) << " GB" << endl; - cout << setw(w1) << "maxSharedMemoryPerMultiProcessor: " << fixed << setprecision(2) << bytesToGB(props.maxSharedMemoryPerMultiProcessor) << " GB" << endl; + cout << setw(w1) << "clockInstructionRate: " << (float)props.clockInstructionRate / 1000.0 + << " Mhz" << endl; + cout << setw(w1) << "totalGlobalMem: " << fixed << setprecision(2) + << bytesToGB(props.totalGlobalMem) << " GB" << endl; + cout << setw(w1) << "maxSharedMemoryPerMultiProcessor: " << fixed << setprecision(2) + << bytesToGB(props.maxSharedMemoryPerMultiProcessor) << " GB" << endl; cout << setw(w1) << "totalConstMem: " << props.totalConstMem << endl; - cout << setw(w1) << "sharedMemPerBlock: " << (float)props.sharedMemPerBlock / 1024.0 << " KB" << endl; + cout << setw(w1) << "sharedMemPerBlock: " << (float)props.sharedMemPerBlock / 1024.0 << " KB" + << endl; cout << setw(w1) << "regsPerBlock: " << props.regsPerBlock << endl; cout << setw(w1) << "warpSize: " << props.warpSize << endl; cout << setw(w1) << "l2CacheSize: " << props.l2CacheSize << endl; @@ -112,29 +114,31 @@ void printDeviceProp (int deviceId) cout << setw(w1) << "major: " << props.major << endl; cout << setw(w1) << "minor: " << props.minor << endl; cout << setw(w1) << "concurrentKernels: " << props.concurrentKernels << endl; - cout << setw(w1) << "arch.hasGlobalInt32Atomics: " << props.arch.hasGlobalInt32Atomics << endl; - cout << setw(w1) << "arch.hasGlobalFloatAtomicExch: " << props.arch.hasGlobalFloatAtomicExch << endl; - cout << setw(w1) << "arch.hasSharedInt32Atomics: " << props.arch.hasSharedInt32Atomics << endl; - cout << setw(w1) << "arch.hasSharedFloatAtomicExch: " << props.arch.hasSharedFloatAtomicExch << endl; - cout << setw(w1) << "arch.hasFloatAtomicAdd: " << props.arch.hasFloatAtomicAdd << endl; - cout << setw(w1) << "arch.hasGlobalInt64Atomics: " << props.arch.hasGlobalInt64Atomics << endl; - cout << setw(w1) << "arch.hasSharedInt64Atomics: " << props.arch.hasSharedInt64Atomics << endl; - cout << setw(w1) << "arch.hasDoubles: " << props.arch.hasDoubles << endl; - cout << setw(w1) << "arch.hasWarpVote: " << props.arch.hasWarpVote << endl; - cout << setw(w1) << "arch.hasWarpBallot: " << props.arch.hasWarpBallot << endl; - cout << setw(w1) << "arch.hasWarpShuffle: " << props.arch.hasWarpShuffle << endl; - cout << setw(w1) << "arch.hasFunnelShift: " << props.arch.hasFunnelShift << endl; - cout << setw(w1) << "arch.hasThreadFenceSystem: " << props.arch.hasThreadFenceSystem << endl; - cout << setw(w1) << "arch.hasSyncThreadsExt: " << props.arch.hasSyncThreadsExt << endl; - cout << setw(w1) << "arch.hasSurfaceFuncs: " << props.arch.hasSurfaceFuncs << endl; - cout << setw(w1) << "arch.has3dGrid: " << props.arch.has3dGrid << endl; - cout << setw(w1) << "arch.hasDynamicParallelism: " << props.arch.hasDynamicParallelism << endl; - cout << setw(w1) << "gcnArch: " << props.gcnArch << endl; + cout << setw(w1) << "arch.hasGlobalInt32Atomics: " << props.arch.hasGlobalInt32Atomics << endl; + cout << setw(w1) << "arch.hasGlobalFloatAtomicExch: " << props.arch.hasGlobalFloatAtomicExch + << endl; + cout << setw(w1) << "arch.hasSharedInt32Atomics: " << props.arch.hasSharedInt32Atomics << endl; + cout << setw(w1) << "arch.hasSharedFloatAtomicExch: " << props.arch.hasSharedFloatAtomicExch + << endl; + cout << setw(w1) << "arch.hasFloatAtomicAdd: " << props.arch.hasFloatAtomicAdd << endl; + cout << setw(w1) << "arch.hasGlobalInt64Atomics: " << props.arch.hasGlobalInt64Atomics << endl; + cout << setw(w1) << "arch.hasSharedInt64Atomics: " << props.arch.hasSharedInt64Atomics << endl; + cout << setw(w1) << "arch.hasDoubles: " << props.arch.hasDoubles << endl; + cout << setw(w1) << "arch.hasWarpVote: " << props.arch.hasWarpVote << endl; + cout << setw(w1) << "arch.hasWarpBallot: " << props.arch.hasWarpBallot << endl; + cout << setw(w1) << "arch.hasWarpShuffle: " << props.arch.hasWarpShuffle << endl; + cout << setw(w1) << "arch.hasFunnelShift: " << props.arch.hasFunnelShift << endl; + cout << setw(w1) << "arch.hasThreadFenceSystem: " << props.arch.hasThreadFenceSystem << endl; + cout << setw(w1) << "arch.hasSyncThreadsExt: " << props.arch.hasSyncThreadsExt << endl; + cout << setw(w1) << "arch.hasSurfaceFuncs: " << props.arch.hasSurfaceFuncs << endl; + cout << setw(w1) << "arch.has3dGrid: " << props.arch.has3dGrid << endl; + cout << setw(w1) << "arch.hasDynamicParallelism: " << props.arch.hasDynamicParallelism << endl; + cout << setw(w1) << "gcnArch: " << props.gcnArch << endl; int deviceCnt; hipGetDeviceCount(&deviceCnt); cout << setw(w1) << "peers: "; - for (int i=0; i +#include // hip header file #include "hip/hip_runtime.h" -#define WIDTH 1024 +#define WIDTH 1024 -#define NUM (WIDTH*WIDTH) +#define NUM (WIDTH * WIDTH) -#define THREADS_PER_BLOCK_X 4 -#define THREADS_PER_BLOCK_Y 4 -#define THREADS_PER_BLOCK_Z 1 +#define THREADS_PER_BLOCK_X 4 +#define THREADS_PER_BLOCK_Y 4 +#define THREADS_PER_BLOCK_Z 1 // Device (Kernel) function, it must be void // hipLaunchParm provides the execution configuration -__global__ void matrixTranspose(hipLaunchParm lp, - float *out, - float *in, - const int width) -{ +__global__ void matrixTranspose(hipLaunchParm lp, float* out, float* in, const int width) { int x = hipBlockDim_x * hipBlockIdx_x + hipThreadIdx_x; int y = hipBlockDim_y * hipBlockIdx_y + hipThreadIdx_y; @@ -49,88 +45,79 @@ __global__ void matrixTranspose(hipLaunchParm lp, } // CPU implementation of matrix transpose -void matrixTransposeCPUReference( - float * output, - float * input, - const unsigned int width) -{ - for(unsigned int j=0; j < width; j++) - { - for(unsigned int i=0; i < width; i++) - { - output[i*width + j] = input[j*width + i]; +void matrixTransposeCPUReference(float* output, float* input, const unsigned int width) { + for (unsigned int j = 0; j < width; j++) { + for (unsigned int i = 0; i < width; i++) { + output[i * width + j] = input[j * width + i]; } } } int main() { + float* Matrix; + float* TransposeMatrix; + float* cpuTransposeMatrix; - float* Matrix; - float* TransposeMatrix; - float* cpuTransposeMatrix; + float* gpuMatrix; + float* gpuTransposeMatrix; - float* gpuMatrix; - float* gpuTransposeMatrix; + hipDeviceProp_t devProp; + hipGetDeviceProperties(&devProp, 0); - hipDeviceProp_t devProp; - hipGetDeviceProperties(&devProp, 0); + std::cout << "Device name " << devProp.name << std::endl; - std::cout << "Device name " << devProp.name << std::endl; + int i; + int errors; - int i; - int errors; + Matrix = (float*)malloc(NUM * sizeof(float)); + TransposeMatrix = (float*)malloc(NUM * sizeof(float)); + cpuTransposeMatrix = (float*)malloc(NUM * sizeof(float)); - Matrix = (float*)malloc(NUM * sizeof(float)); - TransposeMatrix = (float*)malloc(NUM * sizeof(float)); - cpuTransposeMatrix = (float*)malloc(NUM * sizeof(float)); - - // initialize the input data - for (i = 0; i < NUM; i++) { - Matrix[i] = (float)i*10.0f; - } - - // allocate the memory on the device side - hipMalloc((void**)&gpuMatrix, NUM * sizeof(float)); - hipMalloc((void**)&gpuTransposeMatrix, NUM * sizeof(float)); - - // Memory transfer from host to device - hipMemcpy(gpuMatrix, Matrix, NUM*sizeof(float), hipMemcpyHostToDevice); - - // Lauching kernel from host - hipLaunchKernel(matrixTranspose, - dim3(WIDTH/THREADS_PER_BLOCK_X, WIDTH/THREADS_PER_BLOCK_Y), - dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), - 0, 0, - gpuTransposeMatrix , gpuMatrix, WIDTH); - - // Memory transfer from device to host - hipMemcpy(TransposeMatrix, gpuTransposeMatrix, NUM*sizeof(float), hipMemcpyDeviceToHost); - - // CPU MatrixTranspose computation - matrixTransposeCPUReference(cpuTransposeMatrix, Matrix, WIDTH); - - // verify the results - errors = 0; - double eps = 1.0E-6; - for (i = 0; i < NUM; i++) { - if (std::abs(TransposeMatrix[i] - cpuTransposeMatrix[i]) > eps ) { - errors++; + // initialize the input data + for (i = 0; i < NUM; i++) { + Matrix[i] = (float)i * 10.0f; } - } - if (errors!=0) { - printf("FAILED: %d errors\n",errors); - } else { - printf ("PASSED!\n"); - } - //free the resources on device side - hipFree(gpuMatrix); - hipFree(gpuTransposeMatrix); + // allocate the memory on the device side + hipMalloc((void**)&gpuMatrix, NUM * sizeof(float)); + hipMalloc((void**)&gpuTransposeMatrix, NUM * sizeof(float)); - //free the resources on host side - free(Matrix); - free(TransposeMatrix); - free(cpuTransposeMatrix); + // Memory transfer from host to device + hipMemcpy(gpuMatrix, Matrix, NUM * sizeof(float), hipMemcpyHostToDevice); - return errors; + // Lauching kernel from host + hipLaunchKernel(matrixTranspose, dim3(WIDTH / THREADS_PER_BLOCK_X, WIDTH / THREADS_PER_BLOCK_Y), + dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), 0, 0, gpuTransposeMatrix, + gpuMatrix, WIDTH); + + // Memory transfer from device to host + hipMemcpy(TransposeMatrix, gpuTransposeMatrix, NUM * sizeof(float), hipMemcpyDeviceToHost); + + // CPU MatrixTranspose computation + matrixTransposeCPUReference(cpuTransposeMatrix, Matrix, WIDTH); + + // verify the results + errors = 0; + double eps = 1.0E-6; + for (i = 0; i < NUM; i++) { + if (std::abs(TransposeMatrix[i] - cpuTransposeMatrix[i]) > eps) { + errors++; + } + } + if (errors != 0) { + printf("FAILED: %d errors\n", errors); + } else { + printf("PASSED!\n"); + } + + // free the resources on device side + hipFree(gpuMatrix); + hipFree(gpuTransposeMatrix); + + // free the resources on host side + free(Matrix); + free(TransposeMatrix); + free(cpuTransposeMatrix); + + return errors; } diff --git a/hipamd/samples/2_Cookbook/10_inline_asm/inline_asm.cpp b/hipamd/samples/2_Cookbook/10_inline_asm/inline_asm.cpp index 2b4fc3de90..d9aee9c0a8 100644 --- a/hipamd/samples/2_Cookbook/10_inline_asm/inline_asm.cpp +++ b/hipamd/samples/2_Cookbook/10_inline_asm/inline_asm.cpp @@ -20,155 +20,141 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include // hip header file #include "hip/hip_runtime.h" -#define WIDTH 1024 +#define WIDTH 1024 -#define NUM (WIDTH*WIDTH) +#define NUM (WIDTH * WIDTH) -#define THREADS_PER_BLOCK_X 4 -#define THREADS_PER_BLOCK_Y 4 -#define THREADS_PER_BLOCK_Z 1 +#define THREADS_PER_BLOCK_X 4 +#define THREADS_PER_BLOCK_Y 4 +#define THREADS_PER_BLOCK_Z 1 // Device (Kernel) function, it must be void // hipLaunchParm provides the execution configuration -__global__ void matrixTranspose(hipLaunchParm lp, - float *out, - float *in, - const int width) -{ - +__global__ void matrixTranspose(hipLaunchParm lp, float* out, float* in, const int width) { int x = hipBlockDim_x * hipBlockIdx_x + hipThreadIdx_x; int y = hipBlockDim_y * hipBlockIdx_y + hipThreadIdx_y; - asm volatile ("v_mov_b32_e32 %0, %1" : "=v" (out[x*width + y]) : "v" (in[y*width + x])); + asm volatile("v_mov_b32_e32 %0, %1" : "=v"(out[x * width + y]) : "v"(in[y * width + x])); } // CPU implementation of matrix transpose -void matrixTransposeCPUReference( - float * output, - float * input, - const unsigned int width) -{ - for(unsigned int j=0; j < width; j++) - { - for(unsigned int i=0; i < width; i++) - { - output[i*width + j] = input[j*width + i]; +void matrixTransposeCPUReference(float* output, float* input, const unsigned int width) { + for (unsigned int j = 0; j < width; j++) { + for (unsigned int i = 0; i < width; i++) { + output[i * width + j] = input[j * width + i]; } } } int main() { + float* Matrix; + float* TransposeMatrix; + float* cpuTransposeMatrix; - float* Matrix; - float* TransposeMatrix; - float* cpuTransposeMatrix; + float* gpuMatrix; + float* gpuTransposeMatrix; - float* gpuMatrix; - float* gpuTransposeMatrix; + hipDeviceProp_t devProp; + hipGetDeviceProperties(&devProp, 0); - hipDeviceProp_t devProp; - hipGetDeviceProperties(&devProp, 0); + std::cout << "Device name " << devProp.name << std::endl; - std::cout << "Device name " << devProp.name << std::endl; + hipEvent_t start, stop; + hipEventCreate(&start); + hipEventCreate(&stop); + float eventMs = 1.0f; - hipEvent_t start, stop; - hipEventCreate(&start); - hipEventCreate(&stop); - float eventMs = 1.0f; + int i; + int errors; - int i; - int errors; + Matrix = (float*)malloc(NUM * sizeof(float)); + TransposeMatrix = (float*)malloc(NUM * sizeof(float)); + cpuTransposeMatrix = (float*)malloc(NUM * sizeof(float)); - Matrix = (float*)malloc(NUM * sizeof(float)); - TransposeMatrix = (float*)malloc(NUM * sizeof(float)); - cpuTransposeMatrix = (float*)malloc(NUM * sizeof(float)); - - // initialize the input data - for (i = 0; i < NUM; i++) { - Matrix[i] = (float)i*10.0f; - } - - // allocate the memory on the device side - hipMalloc((void**)&gpuMatrix, NUM * sizeof(float)); - hipMalloc((void**)&gpuTransposeMatrix, NUM * sizeof(float)); - - // Record the start event - hipEventRecord(start, NULL); - - // Memory transfer from host to device - hipMemcpy(gpuMatrix, Matrix, NUM*sizeof(float), hipMemcpyHostToDevice); - - // Record the stop event - hipEventRecord(stop, NULL); - hipEventSynchronize(stop); - - hipEventElapsedTime(&eventMs, start, stop); - - printf ("hipMemcpyHostToDevice time taken = %6.3fms\n", eventMs); - - // Record the start event - hipEventRecord(start, NULL); - - // Lauching kernel from host - hipLaunchKernel(matrixTranspose, - dim3(WIDTH/THREADS_PER_BLOCK_X, WIDTH/THREADS_PER_BLOCK_Y), - dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), - 0, 0, - gpuTransposeMatrix , gpuMatrix, WIDTH); - - // Record the stop event - hipEventRecord(stop, NULL); - hipEventSynchronize(stop); - - hipEventElapsedTime(&eventMs, start, stop); - - printf ("kernel Execution time = %6.3fms\n", eventMs); - - // Record the start event - hipEventRecord(start, NULL); - - // Memory transfer from device to host - hipMemcpy(TransposeMatrix, gpuTransposeMatrix, NUM*sizeof(float), hipMemcpyDeviceToHost); - - // Record the stop event - hipEventRecord(stop, NULL); - hipEventSynchronize(stop); - - hipEventElapsedTime(&eventMs, start, stop); - - printf ("hipMemcpyDeviceToHost time taken = %6.3fms\n", eventMs); - - // CPU MatrixTranspose computation - matrixTransposeCPUReference(cpuTransposeMatrix, Matrix, WIDTH); - - // verify the results - errors = 0; - double eps = 1.0E-6; - for (i = 0; i < NUM; i++) { - if (std::abs(TransposeMatrix[i] - cpuTransposeMatrix[i]) > eps ) { - printf("gpu%f cpu %f \n",TransposeMatrix[i],cpuTransposeMatrix[i]); - errors++; + // initialize the input data + for (i = 0; i < NUM; i++) { + Matrix[i] = (float)i * 10.0f; } - } - if (errors!=0) { - printf("FAILED: %d errors\n",errors); - } else { - printf ("PASSED!\n"); - } - //free the resources on device side - hipFree(gpuMatrix); - hipFree(gpuTransposeMatrix); + // allocate the memory on the device side + hipMalloc((void**)&gpuMatrix, NUM * sizeof(float)); + hipMalloc((void**)&gpuTransposeMatrix, NUM * sizeof(float)); - //free the resources on host side - free(Matrix); - free(TransposeMatrix); - free(cpuTransposeMatrix); + // Record the start event + hipEventRecord(start, NULL); - return errors; + // Memory transfer from host to device + hipMemcpy(gpuMatrix, Matrix, NUM * sizeof(float), hipMemcpyHostToDevice); + + // Record the stop event + hipEventRecord(stop, NULL); + hipEventSynchronize(stop); + + hipEventElapsedTime(&eventMs, start, stop); + + printf("hipMemcpyHostToDevice time taken = %6.3fms\n", eventMs); + + // Record the start event + hipEventRecord(start, NULL); + + // Lauching kernel from host + hipLaunchKernel(matrixTranspose, dim3(WIDTH / THREADS_PER_BLOCK_X, WIDTH / THREADS_PER_BLOCK_Y), + dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), 0, 0, gpuTransposeMatrix, + gpuMatrix, WIDTH); + + // Record the stop event + hipEventRecord(stop, NULL); + hipEventSynchronize(stop); + + hipEventElapsedTime(&eventMs, start, stop); + + printf("kernel Execution time = %6.3fms\n", eventMs); + + // Record the start event + hipEventRecord(start, NULL); + + // Memory transfer from device to host + hipMemcpy(TransposeMatrix, gpuTransposeMatrix, NUM * sizeof(float), hipMemcpyDeviceToHost); + + // Record the stop event + hipEventRecord(stop, NULL); + hipEventSynchronize(stop); + + hipEventElapsedTime(&eventMs, start, stop); + + printf("hipMemcpyDeviceToHost time taken = %6.3fms\n", eventMs); + + // CPU MatrixTranspose computation + matrixTransposeCPUReference(cpuTransposeMatrix, Matrix, WIDTH); + + // verify the results + errors = 0; + double eps = 1.0E-6; + for (i = 0; i < NUM; i++) { + if (std::abs(TransposeMatrix[i] - cpuTransposeMatrix[i]) > eps) { + printf("gpu%f cpu %f \n", TransposeMatrix[i], cpuTransposeMatrix[i]); + errors++; + } + } + if (errors != 0) { + printf("FAILED: %d errors\n", errors); + } else { + printf("PASSED!\n"); + } + + // free the resources on device side + hipFree(gpuMatrix); + hipFree(gpuTransposeMatrix); + + // free the resources on host side + free(Matrix); + free(TransposeMatrix); + free(cpuTransposeMatrix); + + return errors; } diff --git a/hipamd/samples/2_Cookbook/11_texture_driver/tex2dKernel.cpp b/hipamd/samples/2_Cookbook/11_texture_driver/tex2dKernel.cpp index 17ed911808..c817f4e42c 100644 --- a/hipamd/samples/2_Cookbook/11_texture_driver/tex2dKernel.cpp +++ b/hipamd/samples/2_Cookbook/11_texture_driver/tex2dKernel.cpp @@ -23,11 +23,8 @@ THE SOFTWARE. #include "hip/hip_runtime.h" extern texture tex; -__global__ void tex2dKernel(hipLaunchParm lp, float* outputData, - int width, - int height) -{ - int x = hipBlockIdx_x*hipBlockDim_x + hipThreadIdx_x; - int y = hipBlockIdx_y*hipBlockDim_y + hipThreadIdx_y; - outputData[y*width + x] = tex2D(tex, x, y); +__global__ void tex2dKernel(hipLaunchParm lp, float* outputData, int width, int height) { + int x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + int y = hipBlockIdx_y * hipBlockDim_y + hipThreadIdx_y; + outputData[y * width + x] = tex2D(tex, x, y); } diff --git a/hipamd/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp b/hipamd/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp index a19f4376c3..322bd1370e 100644 --- a/hipamd/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp +++ b/hipamd/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp @@ -32,111 +32,113 @@ THE SOFTWARE. texture tex; bool testResult = false; -#define HIP_CHECK(cmd) \ -{\ - hipError_t status = cmd;\ - if(status != hipSuccess) {std::cout<<"error: #"<