diff --git a/hipamd/include/hip/amd_detail/hip_prof_str.h b/hipamd/include/hip/amd_detail/hip_prof_str.h index 8e527ca6bd..069f0fac7e 100644 --- a/hipamd/include/hip/amd_detail/hip_prof_str.h +++ b/hipamd/include/hip/amd_detail/hip_prof_str.h @@ -1578,7 +1578,7 @@ typedef struct hip_api_data_s { struct { int* value; int value__val; - hipFunction_attribute attrib; + hipFuncAttribute attrib; hipFunction_t hfunc; } hipFuncGetAttribute; struct { @@ -3713,10 +3713,10 @@ typedef struct hip_api_data_s { #define INIT_hipFreeMipmappedArray_CB_ARGS_DATA(cb_data) { \ cb_data.args.hipFreeMipmappedArray.mipmappedArray = (hipMipmappedArray_t)mipmappedArray; \ }; -// hipFuncGetAttribute[('int*', 'value'), ('hipFunction_attribute', 'attrib'), ('hipFunction_t', 'hfunc')] +// hipFuncGetAttribute[('int*', 'value'), ('hipFuncAttribute ', 'attrib'), ('hipFunction_t', 'hfunc')] #define INIT_hipFuncGetAttribute_CB_ARGS_DATA(cb_data) { \ cb_data.args.hipFuncGetAttribute.value = (int*)value; \ - cb_data.args.hipFuncGetAttribute.attrib = (hipFunction_attribute)attrib; \ + cb_data.args.hipFuncGetAttribute.attrib = (hipFuncAttribute )attrib; \ cb_data.args.hipFuncGetAttribute.hfunc = (hipFunction_t)hfunc; \ }; // hipFuncGetAttributes[('hipFuncAttributes*', 'attr'), ('const void*', 'func')] @@ -5851,7 +5851,7 @@ static inline void hipApiArgsInit(hip_api_id_t id, hip_api_data_t* data) { // hipFreeMipmappedArray[('hipMipmappedArray_t', 'mipmappedArray')] case HIP_API_ID_hipFreeMipmappedArray: break; -// hipFuncGetAttribute[('int*', 'value'), ('hipFunction_attribute', 'attrib'), ('hipFunction_t', 'hfunc')] +// hipFuncGetAttribute[('int*', 'value'), ('hipFuncAttribute ', 'attrib'), ('hipFunction_t', 'hfunc')] case HIP_API_ID_hipFuncGetAttribute: if (data->args.hipFuncGetAttribute.value) data->args.hipFuncGetAttribute.value__val = *(data->args.hipFuncGetAttribute.value); break; diff --git a/hipamd/include/hip/nvidia_detail/nvidia_hip_runtime_api.h b/hipamd/include/hip/nvidia_detail/nvidia_hip_runtime_api.h index 11c4d03862..c7508ba716 100644 --- a/hipamd/include/hip/nvidia_detail/nvidia_hip_runtime_api.h +++ b/hipamd/include/hip/nvidia_detail/nvidia_hip_runtime_api.h @@ -444,7 +444,7 @@ typedef struct cudaArray* hipArray_const_t; typedef struct cudaFuncAttributes hipFuncAttributes; typedef struct cudaLaunchParams hipLaunchParams; typedef CUDA_LAUNCH_PARAMS hipFunctionLaunchParams; -#define hipFunction_attribute CUfunction_attribute +#define hipFuncAttribute CUfunction_attribute #define hipPointer_attribute CUpointer_attribute #define hip_Memcpy2D CUDA_MEMCPY2D #define HIP_MEMCPY3D CUDA_MEMCPY3D @@ -2764,7 +2764,7 @@ inline static hipError_t hipFuncGetAttributes(hipFuncAttributes* attr, const voi return hipCUDAErrorTohipError(cudaFuncGetAttributes(attr, func)); } -inline static hipError_t hipFuncGetAttribute (int* value, hipFunction_attribute attrib, hipFunction_t hfunc) { +inline static hipError_t hipFuncGetAttribute (int* value, hipFuncAttribute attrib, hipFunction_t hfunc) { return hipCUResultTohipError(cuFuncGetAttribute(value, attrib, hfunc)); } diff --git a/hipamd/src/hip_formatting.hpp b/hipamd/src/hip_formatting.hpp index 00a27476be..57b7205ffc 100644 --- a/hipamd/src/hip_formatting.hpp +++ b/hipamd/src/hip_formatting.hpp @@ -257,43 +257,43 @@ inline std::ostream& operator<<(std::ostream& os, const hipResourceViewFormat& s return os; } -inline std::ostream& operator<<(std::ostream& os, const hipFunction_attribute& s) { +inline std::ostream& operator<<(std::ostream& os, const hipFuncAttribute& s) { switch (s) { - case HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK: - os << "HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK"; + case hipFuncAttributeMaxThreadsPerBlock: + os << "hipFuncAttributeMaxThreadsPerBlock"; break; - case HIP_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES: - os << "HIP_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES"; + case hipFuncAttributeSharedSizeBytes: + os << "hipFuncAttributeSharedSizeBytes"; break; - case HIP_FUNC_ATTRIBUTE_CONST_SIZE_BYTES: - os << "HIP_FUNC_ATTRIBUTE_CONST_SIZE_BYTES"; + case hipFuncAttributeConstSizeBytes: + os << "hipFuncAttributeConstSizeBytes"; break; - case HIP_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES: - os << "HIP_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES"; + case hipFuncAttributeLocalSizeBytes: + os << "hipFuncAttributeLocalSizeBytes"; break; - case HIP_FUNC_ATTRIBUTE_NUM_REGS: - os << "HIP_FUNC_ATTRIBUTE_NUM_REGS"; + case hipFuncAttributeNumRegs: + os << "hipFuncAttributeNumRegs"; break; - case HIP_FUNC_ATTRIBUTE_PTX_VERSION: - os << "HIP_FUNC_ATTRIBUTE_PTX_VERSION"; + case hipFuncAttributePTXVersion: + os << "hipFuncAttributePTXVersion"; break; - case HIP_FUNC_ATTRIBUTE_BINARY_VERSION: - os << "HIP_FUNC_ATTRIBUTE_BINARY_VERSION"; + case hipFuncAttributeBinaryVersion: + os << "hipFuncAttributeBinaryVersion"; break; - case HIP_FUNC_ATTRIBUTE_CACHE_MODE_CA: - os << "HIP_FUNC_ATTRIBUTE_CACHE_MODE_CA"; + case hipFuncAttributeCacheModeCA: + os << "hipFuncAttributeCacheModeCA"; break; - case HIP_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES: - os << "HIP_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES"; + case hipFuncAttributeMaxDynamicSharedMemorySize: + os << "hipFuncAttributeMaxDynamicSharedSizeBytes"; break; - case HIP_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT: - os << "HIP_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT"; + case hipFuncAttributePreferredSharedMemoryCarveout: + os << "hipFuncAttributePreferredSharedMemoryCarveout"; break; - case HIP_FUNC_ATTRIBUTE_MAX: - os << "HIP_FUNC_ATTRIBUTE_MAX"; + case hipFuncAttributeMax: + os << "hipFuncAttributeMax"; break; default: - os << "HIP_FUNC_ATTRIBUTE_MAX"; + os << "hipFuncAttributeMax"; }; return os; } diff --git a/hipamd/src/hip_module.cpp b/hipamd/src/hip_module.cpp index eea5efd41b..7d99cb5210 100644 --- a/hipamd/src/hip_module.cpp +++ b/hipamd/src/hip_module.cpp @@ -111,7 +111,7 @@ hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes, hipModule_t h HIP_RETURN(hipSuccess); } -hipError_t hipFuncGetAttribute(int* value, hipFunction_attribute attrib, hipFunction_t hfunc) { +hipError_t hipFuncGetAttribute(int* value, hipFuncAttribute attrib, hipFunction_t hfunc) { HIP_INIT_API(hipFuncGetAttribute, value, attrib, hfunc); if ((value == nullptr)) { @@ -135,34 +135,34 @@ hipError_t hipFuncGetAttribute(int* value, hipFunction_attribute attrib, hipFunc } switch (attrib) { - case HIP_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES: + case hipFuncAttributeSharedSizeBytes: *value = static_cast(wrkGrpInfo->localMemSize_); break; - case HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK: + case hipFuncAttributeMaxThreadsPerBlock: *value = static_cast(wrkGrpInfo->size_); break; - case HIP_FUNC_ATTRIBUTE_CONST_SIZE_BYTES: + case hipFuncAttributeConstSizeBytes: *value = 0; break; - case HIP_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES: + case hipFuncAttributeLocalSizeBytes: *value = static_cast(wrkGrpInfo->privateMemSize_); break; - case HIP_FUNC_ATTRIBUTE_NUM_REGS: + case hipFuncAttributeNumRegs: *value = static_cast(wrkGrpInfo->usedVGPRs_); break; - case HIP_FUNC_ATTRIBUTE_PTX_VERSION: + case hipFuncAttributePTXVersion: *value = 30; // Defaults to 3.0 as HCC break; - case HIP_FUNC_ATTRIBUTE_BINARY_VERSION: + case hipFuncAttributeBinaryVersion: *value = static_cast(kernel->signature().version()); break; - case HIP_FUNC_ATTRIBUTE_CACHE_MODE_CA: + case hipFuncAttributeCacheModeCA: *value = 0; break; - case HIP_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES: + case hipFuncAttributeMaxDynamicSharedMemorySize: *value = static_cast(wrkGrpInfo->availableLDSSize_ - wrkGrpInfo->localMemSize_); break; - case HIP_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT: + case hipFuncAttributePreferredSharedMemoryCarveout: *value = 0; break; default: