SWDEV-420822 - [ABI Break] Merge hipFunction_attribute into hipFuncAttribute

Change-Id: I9b9f7979e9b8dd422d9064c17c79a25bf7248d30
This commit is contained in:
Ioannis Assiouras
2023-09-07 17:08:31 +01:00
zatwierdzone przez Rakesh Roy
rodzic ae9a956fd3
commit c469f18e91
4 zmienionych plików z 41 dodań i 41 usunięć
@@ -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;
@@ -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));
}
+24 -24
Wyświetl plik
@@ -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;
}
+11 -11
Wyświetl plik
@@ -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<int>(wrkGrpInfo->localMemSize_);
break;
case HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK:
case hipFuncAttributeMaxThreadsPerBlock:
*value = static_cast<int>(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<int>(wrkGrpInfo->privateMemSize_);
break;
case HIP_FUNC_ATTRIBUTE_NUM_REGS:
case hipFuncAttributeNumRegs:
*value = static_cast<int>(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<int>(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<int>(wrkGrpInfo->availableLDSSize_ - wrkGrpInfo->localMemSize_);
break;
case HIP_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT:
case hipFuncAttributePreferredSharedMemoryCarveout:
*value = 0;
break;
default: