diff --git a/CHANGELOG.md b/CHANGELOG.md index b0f0cf9fef..734ec5ac23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,10 @@ Full documentation for HIP is available at [rocm.docs.amd.com](https://rocm.docs * Soft hang when use AMD_SERIALIZE_KERNEL. * Memory leak in hipIpcCloseMemHandle. +### Added +- Added new HIP APIs + - `hipDeviceGetTexture1DLinearMaxWidth` returns the maximum number of elements allocatable in a 1D linear texture for a given element size. + ## HIP 6.2 (For ROCm 6.2) ### Added diff --git a/hipamd/include/hip/amd_detail/hip_api_trace.hpp b/hipamd/include/hip/amd_detail/hip_api_trace.hpp index 50ac4a234d..d34a8d4825 100644 --- a/hipamd/include/hip/amd_detail/hip_api_trace.hpp +++ b/hipamd/include/hip/amd_detail/hip_api_trace.hpp @@ -61,7 +61,7 @@ // - Reset any of the *_STEP_VERSION defines to zero if the corresponding *_MAJOR_VERSION increases #define HIP_API_TABLE_STEP_VERSION 0 #define HIP_COMPILER_API_TABLE_STEP_VERSION 0 -#define HIP_RUNTIME_API_TABLE_STEP_VERSION 5 +#define HIP_RUNTIME_API_TABLE_STEP_VERSION 6 // HIP API interface typedef hipError_t (*t___hipPopCallConfiguration)(dim3* gridDim, dim3* blockDim, size_t* sharedMem, @@ -1001,6 +1001,9 @@ typedef hipError_t (*t_hipDrvGraphMemcpyNodeSetParams)(hipGraphNode_t hNode, typedef hipError_t (*t_hipExtHostAlloc)(void **ptr, size_t size, unsigned int flags); +typedef hipError_t (*t_hipDeviceGetTexture1DLinearMaxWidth)(size_t *maxWidthInElements, + const hipChannelFormatDesc *fmtDesc, + int device); // HIP Compiler dispatch table struct HipCompilerDispatchTable { size_t size; @@ -1484,4 +1487,5 @@ struct HipDispatchTable { t_hipDrvGraphMemcpyNodeGetParams hipDrvGraphMemcpyNodeGetParams_fn; t_hipDrvGraphMemcpyNodeSetParams hipDrvGraphMemcpyNodeSetParams_fn; t_hipExtHostAlloc hipExtHostAlloc_fn; + t_hipDeviceGetTexture1DLinearMaxWidth hipDeviceGetTexture1DLinearMaxWidth_fn; }; diff --git a/hipamd/include/hip/amd_detail/hip_prof_str.h b/hipamd/include/hip/amd_detail/hip_prof_str.h index e7c67e5c54..e11b1abcf3 100644 --- a/hipamd/include/hip/amd_detail/hip_prof_str.h +++ b/hipamd/include/hip/amd_detail/hip_prof_str.h @@ -437,6 +437,7 @@ enum hip_api_id_t { HIP_API_ID_hipCreateTextureObject = HIP_API_ID_NONE, HIP_API_ID_hipDestroyTextureObject = HIP_API_ID_NONE, HIP_API_ID_hipDeviceGetCount = HIP_API_ID_NONE, + HIP_API_ID_hipDeviceGetTexture1DLinearMaxWidth = HIP_API_ID_NONE, HIP_API_ID_hipGetTextureAlignmentOffset = HIP_API_ID_NONE, HIP_API_ID_hipGetTextureObjectResourceDesc = HIP_API_ID_NONE, HIP_API_ID_hipGetTextureObjectResourceViewDesc = HIP_API_ID_NONE, @@ -3977,9 +3978,13 @@ typedef struct hip_api_data_s { }; // hipDrvGraphMemcpyNodeGetParams[('hipGraphNode_t', 'hNode'), ('HIP_MEMCPY3D*', 'nodeParams')] #define INIT_hipDrvGraphMemcpyNodeGetParams_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipDrvGraphMemcpyNodeGetParams.hNode = (hipGraphNode_t)hNode; \ + cb_data.args.hipDrvGraphMemcpyNodeGetParams.nodeParams = (HIP_MEMCPY3D*)nodeParams; \ }; // hipDrvGraphMemcpyNodeSetParams[('hipGraphNode_t', 'hNode'), ('const HIP_MEMCPY3D*', 'nodeParams')] #define INIT_hipDrvGraphMemcpyNodeSetParams_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipDrvGraphMemcpyNodeSetParams.hNode = (hipGraphNode_t)hNode; \ + cb_data.args.hipDrvGraphMemcpyNodeSetParams.nodeParams = (const HIP_MEMCPY3D*)nodeParams; \ }; // hipDrvMemcpy2DUnaligned[('const hip_Memcpy2D*', 'pCopy')] #define INIT_hipDrvMemcpy2DUnaligned_CB_ARGS_DATA(cb_data) { \ @@ -4455,6 +4460,8 @@ typedef struct hip_api_data_s { }; // hipGraphExecGetFlags[('hipGraphExec_t', 'graphExec'), ('unsigned long long*', 'flags')] #define INIT_hipGraphExecGetFlags_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipGraphExecGetFlags.graphExec = (hipGraphExec_t)graphExec; \ + cb_data.args.hipGraphExecGetFlags.flags = (unsigned long long*)flags; \ }; // hipGraphExecHostNodeSetParams[('hipGraphExec_t', 'hGraphExec'), ('hipGraphNode_t', 'node'), ('const hipHostNodeParams*', 'pNodeParams')] #define INIT_hipGraphExecHostNodeSetParams_CB_ARGS_DATA(cb_data) { \ @@ -4511,6 +4518,9 @@ typedef struct hip_api_data_s { }; // hipGraphExecNodeSetParams[('hipGraphExec_t', 'graphExec'), ('hipGraphNode_t', 'node'), ('hipGraphNodeParams*', 'nodeParams')] #define INIT_hipGraphExecNodeSetParams_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipGraphExecNodeSetParams.graphExec = (hipGraphExec_t)graphExec; \ + cb_data.args.hipGraphExecNodeSetParams.node = (hipGraphNode_t)node; \ + cb_data.args.hipGraphExecNodeSetParams.nodeParams = (hipGraphNodeParams*)nodeParams; \ }; // hipGraphExecUpdate[('hipGraphExec_t', 'hGraphExec'), ('hipGraph_t', 'hGraph'), ('hipGraphNode_t*', 'hErrorNode_out'), ('hipGraphExecUpdateResult*', 'updateResult_out')] #define INIT_hipGraphExecUpdate_CB_ARGS_DATA(cb_data) { \ @@ -4707,6 +4717,8 @@ typedef struct hip_api_data_s { }; // hipGraphNodeSetParams[('hipGraphNode_t', 'node'), ('hipGraphNodeParams*', 'nodeParams')] #define INIT_hipGraphNodeSetParams_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipGraphNodeSetParams.node = (hipGraphNode_t)node; \ + cb_data.args.hipGraphNodeSetParams.nodeParams = (hipGraphNodeParams*)nodeParams; \ }; // hipGraphReleaseUserObject[('hipGraph_t', 'graph'), ('hipUserObject_t', 'object'), ('unsigned int', 'count')] #define INIT_hipGraphReleaseUserObject_CB_ARGS_DATA(cb_data) { \ @@ -6031,6 +6043,8 @@ typedef struct hip_api_data_s { #define INIT_hipDestroyTextureObject_CB_ARGS_DATA(cb_data) {}; // hipDeviceGetCount() #define INIT_hipDeviceGetCount_CB_ARGS_DATA(cb_data) {}; +// hipDeviceGetTexture1DLinearMaxWidth() +#define INIT_hipDeviceGetTexture1DLinearMaxWidth_CB_ARGS_DATA(cb_data) {}; // hipGetTextureAlignmentOffset() #define INIT_hipGetTextureAlignmentOffset_CB_ARGS_DATA(cb_data) {}; // hipGetTextureObjectResourceDesc() diff --git a/hipamd/src/amdhip.def b/hipamd/src/amdhip.def index a58fa31547..a119c5e3c4 100644 --- a/hipamd/src/amdhip.def +++ b/hipamd/src/amdhip.def @@ -29,6 +29,7 @@ hipDeviceGetCacheConfig hipDeviceGetStreamPriorityRange hipDeviceGetLimit hipDeviceGetName +hipDeviceGetTexture1DLinearMaxWidth hipDeviceGetUuid hipDeviceGetPCIBusId hipDeviceGetSharedMemConfig diff --git a/hipamd/src/hip_api_trace.cpp b/hipamd/src/hip_api_trace.cpp index 800fd804d2..7613898c34 100644 --- a/hipamd/src/hip_api_trace.cpp +++ b/hipamd/src/hip_api_trace.cpp @@ -121,6 +121,9 @@ hipError_t hipDeviceGetP2PAttribute(int* value, hipDeviceP2PAttr attr, int srcDe hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device); hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig* pConfig); hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority); +hipError_t hipDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, + const hipChannelFormatDesc* fmtDesc, + int device); hipError_t hipDeviceGetUuid(hipUUID* uuid, hipDevice_t device); hipError_t hipDeviceGraphMemTrim(int device); hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, int* active); @@ -872,6 +875,7 @@ void UpdateDispatchTable(HipDispatchTable* ptrDispatchTable) { ptrDispatchTable->hipDeviceGetPCIBusId_fn = hip::hipDeviceGetPCIBusId; ptrDispatchTable->hipDeviceGetSharedMemConfig_fn = hip::hipDeviceGetSharedMemConfig; ptrDispatchTable->hipDeviceGetStreamPriorityRange_fn = hip::hipDeviceGetStreamPriorityRange; + ptrDispatchTable->hipDeviceGetTexture1DLinearMaxWidth_fn = hip::hipDeviceGetTexture1DLinearMaxWidth; ptrDispatchTable->hipDeviceGetUuid_fn = hip::hipDeviceGetUuid; ptrDispatchTable->hipDeviceGraphMemTrim_fn = hip::hipDeviceGraphMemTrim; ptrDispatchTable->hipDevicePrimaryCtxGetState_fn = hip::hipDevicePrimaryCtxGetState; @@ -1873,6 +1877,7 @@ HIP_ENFORCE_ABI(HipDispatchTable, hipExternalMemoryGetMappedMipmappedArray_fn, 4 HIP_ENFORCE_ABI(HipDispatchTable, hipDrvGraphMemcpyNodeGetParams_fn, 459) HIP_ENFORCE_ABI(HipDispatchTable, hipDrvGraphMemcpyNodeSetParams_fn, 460) HIP_ENFORCE_ABI(HipDispatchTable, hipExtHostAlloc_fn, 461) +HIP_ENFORCE_ABI(HipDispatchTable, hipDeviceGetTexture1DLinearMaxWidth_fn, 462) // if HIP_ENFORCE_ABI entries are added for each new function pointer in the table, the number below // will be +1 of the number in the last HIP_ENFORCE_ABI line. E.g.: @@ -1880,9 +1885,9 @@ HIP_ENFORCE_ABI(HipDispatchTable, hipExtHostAlloc_fn, 461) // HIP_ENFORCE_ABI(