From 2aa88a4505514ba65b4c86147e4cd7daad27f90b Mon Sep 17 00:00:00 2001 From: Evgeny Date: Thu, 14 Mar 2019 22:43:52 -0500 Subject: [PATCH] tracing callback layer update --- hipamd/include/hip/hcc_detail/hip_prof_str.h | 1468 ++++++++--------- .../include/hip/hcc_detail/hip_runtime_api.h | 2 +- hipamd/src/hip_intercept.cpp | 2 +- hipamd/src/hip_module.cpp | 4 +- hipamd/src/hip_peer.cpp | 6 +- 5 files changed, 661 insertions(+), 821 deletions(-) diff --git a/hipamd/include/hip/hcc_detail/hip_prof_str.h b/hipamd/include/hip/hcc_detail/hip_prof_str.h index ba11a25222..0eb7636de8 100644 --- a/hipamd/include/hip/hcc_detail/hip_prof_str.h +++ b/hipamd/include/hip/hcc_detail/hip_prof_str.h @@ -4,60 +4,55 @@ #include #include -// Dummy API callbacks definition +// Dummy API primitives #define INIT_NONE_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipHccGetAccelerator_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipHccGetAcceleratorView_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipDeviceCanAccessPeer2_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipMemcpyPeer2_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipMemcpyPeerAsync2_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipCreateTextureObject_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipDestroyTextureObject_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipGetTextureObjectResourceDesc_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipGetTextureObjectResourceViewDesc_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipGetTextureObjectTextureDesc_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipBindTexture_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipBindTexture2D_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipBindTextureToArray_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipBindTextureToMipmappedArray_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipUnbindTexture_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipGetChannelDesc_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipGetTextureAlignmentOffset_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipGetTextureReference_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipTexRefSetFormat_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipTexRefSetFlags_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipTexRefSetFilterMode_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipTexRefSetAddressMode_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipTexRefSetArray_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipTexRefSetAddress_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipTexRefSetAddress2D_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipMemcpyHtoH_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipGetErrorName_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipGetErrorString_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipCreateSurfaceObject_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipMemcpyToSymbolAsync_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipMemcpyFromSymbolAsync_CB_ARGS_DATA(cb_data) {}; #define INIT_hipDestroySurfaceObject_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipStreamCreateWithPriority_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipDeviceGetStreamPriorityRange_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipStreamGetPriority_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipGetSymbolAddress_CB_ARGS_DATA(cb_data) {}; -#define INIT_hipGetSymbolSize_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipTexRefSetAddress_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipGetTextureObjectTextureDesc_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipBindTexture2D_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipTexRefSetAddressMode_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipCreateTextureObject_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipBindTextureToMipmappedArray_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipBindTextureToArray_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipTexRefSetFormat_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipMemcpyFromSymbol_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipMemcpyHtoH_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipGetTextureReference_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipDestroyTextureObject_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipTexRefSetArray_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipTexRefSetAddress2D_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipGetTextureObjectResourceViewDesc_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipUnbindTexture_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipTexRefSetFilterMode_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipCreateSurfaceObject_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipGetChannelDesc_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipHccGetAcceleratorView_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipExtModuleLaunchKernel_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipGetTextureObjectResourceDesc_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipMemcpyToSymbol_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipGetTextureAlignmentOffset_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipTexRefSetFlags_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipBindTexture_CB_ARGS_DATA(cb_data) {}; +#define INIT_hipHccGetAccelerator_CB_ARGS_DATA(cb_data) {}; // HIP API callbacks ID enumaration enum hip_api_id_t { - HIP_API_ID_hipHostFree = 0, - HIP_API_ID_hipMemcpyToSymbolAsync = 1, - HIP_API_ID_hipMallocPitch = 2, - HIP_API_ID_hipMalloc = 3, - HIP_API_ID_hipDeviceGetName = 4, - HIP_API_ID_hipEventRecord = 5, - HIP_API_ID_hipCtxSynchronize = 6, - HIP_API_ID_hipSetDevice = 7, - HIP_API_ID_hipSetupArgument = 8, - HIP_API_ID_hipMemcpyFromSymbolAsync = 9, - HIP_API_ID_hipMemcpyDtoD = 10, - HIP_API_ID_hipMemcpy2DToArray = 11, - HIP_API_ID_hipCtxGetCacheConfig = 12, - HIP_API_ID_hipStreamWaitEvent = 13, + HIP_API_ID_hipStreamCreateWithPriority = 0, + HIP_API_ID_hipMallocPitch = 1, + HIP_API_ID_hipMalloc = 2, + HIP_API_ID_hipEventRecord = 3, + HIP_API_ID_hipCtxSynchronize = 4, + HIP_API_ID_hipSetDevice = 5, + HIP_API_ID_hipCtxGetApiVersion = 6, + HIP_API_ID_hipSetupArgument = 7, + HIP_API_ID_hipMemcpyDtoD = 8, + HIP_API_ID_hipHostFree = 9, + HIP_API_ID_hipMemcpy2DToArray = 10, + HIP_API_ID_hipCtxGetCacheConfig = 11, + HIP_API_ID_hipStreamWaitEvent = 12, + HIP_API_ID_hipDeviceGetStreamPriorityRange = 13, HIP_API_ID_hipModuleLoad = 14, HIP_API_ID_hipDevicePrimaryCtxSetFlags = 15, HIP_API_ID_hipMemcpyAsync = 16, @@ -68,18 +63,18 @@ enum hip_api_id_t { HIP_API_ID_hipEventQuery = 21, HIP_API_ID_hipEventCreate = 22, HIP_API_ID_hipMemGetAddressRange = 23, - HIP_API_ID_hipMemcpyFromSymbol = 24, - HIP_API_ID_hipArrayCreate = 25, - HIP_API_ID_hipStreamGetFlags = 26, - HIP_API_ID_hipMallocArray = 27, - HIP_API_ID_hipCtxGetSharedMemConfig = 28, - HIP_API_ID_hipMemPtrGetInfo = 29, - HIP_API_ID_hipCtxGetFlags = 30, - HIP_API_ID_hipStreamDestroy = 31, - HIP_API_ID_hipMemset3DAsync = 32, - HIP_API_ID_hipMemcpy3D = 33, - HIP_API_ID_hipInit = 34, - HIP_API_ID_hipMemcpyAtoH = 35, + HIP_API_ID_hipArrayCreate = 24, + HIP_API_ID_hipStreamGetFlags = 25, + HIP_API_ID_hipMallocArray = 26, + HIP_API_ID_hipCtxGetSharedMemConfig = 27, + HIP_API_ID_hipMemPtrGetInfo = 28, + HIP_API_ID_hipCtxGetFlags = 29, + HIP_API_ID_hipStreamDestroy = 30, + HIP_API_ID_hipMemset3DAsync = 31, + HIP_API_ID_hipMemcpy3D = 32, + HIP_API_ID_hipInit = 33, + HIP_API_ID_hipMemcpyAtoH = 34, + HIP_API_ID_hipStreamGetPriority = 35, HIP_API_ID_hipMemset2D = 36, HIP_API_ID_hipMemset2DAsync = 37, HIP_API_ID_hipDeviceCanAccessPeer = 38, @@ -89,160 +84,146 @@ enum hip_api_id_t { HIP_API_ID_hipProfilerStop = 42, HIP_API_ID_hipLaunchByPtr = 43, HIP_API_ID_hipStreamSynchronize = 44, - HIP_API_ID_hipFreeHost = 45, - HIP_API_ID_hipRemoveApiCallback = 46, - HIP_API_ID_hipDeviceSetCacheConfig = 47, - HIP_API_ID_hipCtxGetApiVersion = 48, - HIP_API_ID_hipMemcpyHtoD = 49, - HIP_API_ID_hipModuleGetGlobal = 50, - HIP_API_ID_hipMemcpyHtoA = 51, - HIP_API_ID_hipCtxCreate = 52, - HIP_API_ID_hipMemcpy2D = 53, - HIP_API_ID_hipIpcCloseMemHandle = 54, - HIP_API_ID_hipChooseDevice = 55, - HIP_API_ID_hipDeviceSetSharedMemConfig = 56, - HIP_API_ID_hipDeviceComputeCapability = 57, - HIP_API_ID_hipRegisterApiCallback = 58, - HIP_API_ID_hipDeviceGet = 59, - HIP_API_ID_hipProfilerStart = 60, - HIP_API_ID_hipCtxSetCacheConfig = 61, - HIP_API_ID_hipFuncSetCacheConfig = 62, - HIP_API_ID_hipMemcpyPeerAsync = 63, - HIP_API_ID_hipEventElapsedTime = 64, - HIP_API_ID_hipDevicePrimaryCtxReset = 65, - HIP_API_ID_hipEventDestroy = 66, - HIP_API_ID_hipCtxPopCurrent = 67, - HIP_API_ID_hipHostGetFlags = 68, - HIP_API_ID_hipHostMalloc = 69, - HIP_API_ID_hipDriverGetVersion = 70, - HIP_API_ID_hipMemGetInfo = 71, - HIP_API_ID_hipDeviceReset = 72, - HIP_API_ID_hipMemset = 73, - HIP_API_ID_hipMemsetD8 = 74, - HIP_API_ID_hipHostRegister = 75, - HIP_API_ID_hipCtxSetSharedMemConfig = 76, - HIP_API_ID_hipArray3DCreate = 77, - HIP_API_ID_hipIpcOpenMemHandle = 78, - HIP_API_ID_hipGetLastError = 79, - HIP_API_ID_hipCtxDestroy = 80, - HIP_API_ID_hipDeviceGetSharedMemConfig = 81, - HIP_API_ID_hipRegisterActivityCallback = 82, - HIP_API_ID_hipSetDeviceFlags = 83, - HIP_API_ID_hipFree = 84, - HIP_API_ID_hipDeviceGetAttribute = 85, - HIP_API_ID_hipMemcpyDtoH = 86, - HIP_API_ID_hipCtxDisablePeerAccess = 87, - HIP_API_ID_hipDeviceGetByPCIBusId = 88, - HIP_API_ID_hipIpcGetMemHandle = 89, - HIP_API_ID_hipMemcpyHtoDAsync = 90, - HIP_API_ID_hipCtxGetDevice = 91, - HIP_API_ID_hipMemset3D = 92, - HIP_API_ID_hipModuleLoadData = 93, - HIP_API_ID_hipDeviceTotalMem = 94, - HIP_API_ID_hipCtxSetCurrent = 95, - HIP_API_ID_hipMallocHost = 96, - HIP_API_ID_hipDevicePrimaryCtxRetain = 97, - HIP_API_ID_hipDeviceDisablePeerAccess = 98, - HIP_API_ID_hipStreamCreateWithFlags = 99, - HIP_API_ID_hipMemcpyFromArray = 100, - HIP_API_ID_hipMemcpy2DAsync = 101, - HIP_API_ID_hipFuncGetAttributes = 102, - HIP_API_ID_hipEventCreateWithFlags = 103, - HIP_API_ID_hipStreamQuery = 104, - HIP_API_ID_hipDeviceGetPCIBusId = 105, - HIP_API_ID_hipMemcpy = 106, - HIP_API_ID_hipPeekAtLastError = 107, - HIP_API_ID_hipHostAlloc = 108, - HIP_API_ID_hipStreamAddCallback = 109, - HIP_API_ID_hipMemcpyToArray = 110, - HIP_API_ID_hipDeviceSynchronize = 111, - HIP_API_ID_hipDeviceGetCacheConfig = 112, - HIP_API_ID_hipMalloc3D = 113, - HIP_API_ID_hipPointerGetAttributes = 114, - HIP_API_ID_hipMemsetAsync = 115, - HIP_API_ID_hipMemcpyToSymbol = 116, - HIP_API_ID_hipCtxPushCurrent = 117, - HIP_API_ID_hipMemcpyPeer = 118, - HIP_API_ID_hipEventSynchronize = 119, - HIP_API_ID_hipMemcpyDtoDAsync = 120, - HIP_API_ID_hipCtxEnablePeerAccess = 121, - HIP_API_ID_hipMemcpyDtoHAsync = 122, - HIP_API_ID_hipModuleLaunchKernel = 123, - HIP_API_ID_hipModuleGetTexRef = 124, - HIP_API_ID_hipRemoveActivityCallback = 125, - HIP_API_ID_hipDeviceGetLimit = 126, - HIP_API_ID_hipModuleLoadDataEx = 127, - HIP_API_ID_hipRuntimeGetVersion = 128, - HIP_API_ID_hipGetDeviceProperties = 129, - HIP_API_ID_hipFreeArray = 130, - HIP_API_ID_hipDevicePrimaryCtxRelease = 131, - HIP_API_ID_hipHostGetDevicePointer = 132, - HIP_API_ID_hipMemcpyParam2D = 133, - HIP_API_ID_hipConfigureCall = 134, - HIP_API_ID_hipModuleGetFunction = 135, - HIP_API_ID_hipGetDevice = 136, - HIP_API_ID_hipGetDeviceCount = 137, - HIP_API_ID_hipHccModuleLaunchKernel = 138, - HIP_API_ID_hipMemsetD32 = 139, - HIP_API_ID_hipMemsetD32Async = 140, - HIP_API_ID_NUMBER = 141, - HIP_API_ID_ANY = 142, + HIP_API_ID_hipDeviceSetCacheConfig = 45, + HIP_API_ID_hipGetErrorName = 46, + HIP_API_ID_hipMemcpyHtoD = 47, + HIP_API_ID_hipMemcpyHtoA = 48, + HIP_API_ID_hipCtxCreate = 49, + HIP_API_ID_hipMemcpy2D = 50, + HIP_API_ID_hipIpcCloseMemHandle = 51, + HIP_API_ID_hipChooseDevice = 52, + HIP_API_ID_hipDeviceSetSharedMemConfig = 53, + HIP_API_ID_hipDeviceComputeCapability = 54, + HIP_API_ID_hipDeviceGet = 55, + HIP_API_ID_hipProfilerStart = 56, + HIP_API_ID_hipCtxSetCacheConfig = 57, + HIP_API_ID_hipFuncSetCacheConfig = 58, + HIP_API_ID_hipMemcpyPeerAsync = 59, + HIP_API_ID_hipEventElapsedTime = 60, + HIP_API_ID_hipDevicePrimaryCtxReset = 61, + HIP_API_ID_hipEventDestroy = 62, + HIP_API_ID_hipCtxPopCurrent = 63, + HIP_API_ID_hipHostGetFlags = 64, + HIP_API_ID_hipHostMalloc = 65, + HIP_API_ID_hipDriverGetVersion = 66, + HIP_API_ID_hipMemGetInfo = 67, + HIP_API_ID_hipDeviceReset = 68, + HIP_API_ID_hipMemset = 69, + HIP_API_ID_hipMemsetD8 = 70, + HIP_API_ID_hipHostRegister = 71, + HIP_API_ID_hipCtxSetSharedMemConfig = 72, + HIP_API_ID_hipArray3DCreate = 73, + HIP_API_ID_hipIpcOpenMemHandle = 74, + HIP_API_ID_hipGetLastError = 75, + HIP_API_ID_hipCtxDestroy = 76, + HIP_API_ID_hipDeviceGetSharedMemConfig = 77, + HIP_API_ID_hipSetDeviceFlags = 78, + HIP_API_ID_hipHccModuleLaunchKernel = 79, + HIP_API_ID_hipFree = 80, + HIP_API_ID_hipDeviceGetAttribute = 81, + HIP_API_ID_hipMemcpyDtoH = 82, + HIP_API_ID_hipCtxDisablePeerAccess = 83, + HIP_API_ID_hipDeviceGetByPCIBusId = 84, + HIP_API_ID_hipIpcGetMemHandle = 85, + HIP_API_ID_hipMemcpyHtoDAsync = 86, + HIP_API_ID_hipCtxGetDevice = 87, + HIP_API_ID_hipMemset3D = 88, + HIP_API_ID_hipModuleLoadData = 89, + HIP_API_ID_hipDeviceTotalMem = 90, + HIP_API_ID_hipCtxSetCurrent = 91, + HIP_API_ID_hipGetErrorString = 92, + HIP_API_ID_hipDevicePrimaryCtxRetain = 93, + HIP_API_ID_hipDeviceDisablePeerAccess = 94, + HIP_API_ID_hipStreamCreateWithFlags = 95, + HIP_API_ID_hipMemcpyFromArray = 96, + HIP_API_ID_hipMemcpy2DAsync = 97, + HIP_API_ID_hipEventCreateWithFlags = 98, + HIP_API_ID_hipStreamQuery = 99, + HIP_API_ID_hipDeviceGetPCIBusId = 100, + HIP_API_ID_hipMemcpy = 101, + HIP_API_ID_hipPeekAtLastError = 102, + HIP_API_ID_hipStreamAddCallback = 103, + HIP_API_ID_hipMemcpyToArray = 104, + HIP_API_ID_hipMemsetD32 = 105, + HIP_API_ID_hipDeviceSynchronize = 106, + HIP_API_ID_hipDeviceGetCacheConfig = 107, + HIP_API_ID_hipMalloc3D = 108, + HIP_API_ID_hipPointerGetAttributes = 109, + HIP_API_ID_hipMemsetAsync = 110, + HIP_API_ID_hipDeviceGetName = 111, + HIP_API_ID_hipCtxPushCurrent = 112, + HIP_API_ID_hipMemcpyPeer = 113, + HIP_API_ID_hipEventSynchronize = 114, + HIP_API_ID_hipMemcpyDtoDAsync = 115, + HIP_API_ID_hipCtxEnablePeerAccess = 116, + HIP_API_ID_hipMemcpyDtoHAsync = 117, + HIP_API_ID_hipModuleLaunchKernel = 118, + HIP_API_ID_hipModuleGetTexRef = 119, + HIP_API_ID_hipDeviceGetLimit = 120, + HIP_API_ID_hipModuleLoadDataEx = 121, + HIP_API_ID_hipRuntimeGetVersion = 122, + HIP_API_ID_hipGetDeviceProperties = 123, + HIP_API_ID_hipFreeArray = 124, + HIP_API_ID_hipDevicePrimaryCtxRelease = 125, + HIP_API_ID_hipHostGetDevicePointer = 126, + HIP_API_ID_hipMemcpyParam2D = 127, + HIP_API_ID_hipModuleGetFunction = 128, + HIP_API_ID_hipMemsetD32Async = 129, + HIP_API_ID_hipGetDevice = 130, + HIP_API_ID_hipGetDeviceCount = 131, + HIP_API_ID_NUMBER = 132, + HIP_API_ID_ANY = 133, HIP_API_ID_NONE = HIP_API_ID_NUMBER, - HIP_API_ID_hipHccGetAccelerator = HIP_API_ID_NUMBER, - HIP_API_ID_hipHccGetAcceleratorView = HIP_API_ID_NUMBER, - HIP_API_ID_hipDeviceCanAccessPeer2 = HIP_API_ID_NUMBER, - HIP_API_ID_hipMemcpyPeer2 = HIP_API_ID_NUMBER, - HIP_API_ID_hipMemcpyPeerAsync2 = HIP_API_ID_NUMBER, - HIP_API_ID_hipCreateTextureObject = HIP_API_ID_NUMBER, - HIP_API_ID_hipDestroyTextureObject = HIP_API_ID_NUMBER, - HIP_API_ID_hipGetTextureObjectResourceDesc = HIP_API_ID_NUMBER, - HIP_API_ID_hipGetTextureObjectResourceViewDesc = HIP_API_ID_NUMBER, - HIP_API_ID_hipGetTextureObjectTextureDesc = HIP_API_ID_NUMBER, - HIP_API_ID_hipBindTexture = HIP_API_ID_NUMBER, - HIP_API_ID_hipBindTexture2D = HIP_API_ID_NUMBER, - HIP_API_ID_hipBindTextureToArray = HIP_API_ID_NUMBER, - HIP_API_ID_hipBindTextureToMipmappedArray = HIP_API_ID_NUMBER, - HIP_API_ID_hipUnbindTexture = HIP_API_ID_NUMBER, - HIP_API_ID_hipGetChannelDesc = HIP_API_ID_NUMBER, - HIP_API_ID_hipGetTextureAlignmentOffset = HIP_API_ID_NUMBER, - HIP_API_ID_hipGetTextureReference = HIP_API_ID_NUMBER, - HIP_API_ID_hipTexRefSetFormat = HIP_API_ID_NUMBER, - HIP_API_ID_hipTexRefSetFlags = HIP_API_ID_NUMBER, - HIP_API_ID_hipTexRefSetFilterMode = HIP_API_ID_NUMBER, - HIP_API_ID_hipTexRefSetAddressMode = HIP_API_ID_NUMBER, - HIP_API_ID_hipTexRefSetArray = HIP_API_ID_NUMBER, - HIP_API_ID_hipTexRefSetAddress = HIP_API_ID_NUMBER, - HIP_API_ID_hipTexRefSetAddress2D = HIP_API_ID_NUMBER, - HIP_API_ID_hipMemcpyHtoH = HIP_API_ID_NUMBER, - HIP_API_ID_hipGetErrorName = HIP_API_ID_NUMBER, - HIP_API_ID_hipGetErrorString = HIP_API_ID_NUMBER, - HIP_API_ID_hipCreateSurfaceObject = HIP_API_ID_NUMBER, + HIP_API_ID_hipMemcpyToSymbolAsync = HIP_API_ID_NUMBER, + HIP_API_ID_hipMemcpyFromSymbolAsync = HIP_API_ID_NUMBER, HIP_API_ID_hipDestroySurfaceObject = HIP_API_ID_NUMBER, - HIP_API_ID_hipStreamCreateWithPriority = HIP_API_ID_NUMBER, - HIP_API_ID_hipDeviceGetStreamPriorityRange = HIP_API_ID_NUMBER, - HIP_API_ID_hipStreamGetPriority = HIP_API_ID_NUMBER, - HIP_API_ID_hipGetSymbolAddress = HIP_API_ID_NUMBER, - HIP_API_ID_hipGetSymbolSize = HIP_API_ID_NUMBER, + HIP_API_ID_hipTexRefSetAddress = HIP_API_ID_NUMBER, + HIP_API_ID_hipGetTextureObjectTextureDesc = HIP_API_ID_NUMBER, + HIP_API_ID_hipBindTexture2D = HIP_API_ID_NUMBER, + HIP_API_ID_hipTexRefSetAddressMode = HIP_API_ID_NUMBER, + HIP_API_ID_hipCreateTextureObject = HIP_API_ID_NUMBER, + HIP_API_ID_hipBindTextureToMipmappedArray = HIP_API_ID_NUMBER, + HIP_API_ID_hipBindTextureToArray = HIP_API_ID_NUMBER, + HIP_API_ID_hipTexRefSetFormat = HIP_API_ID_NUMBER, + HIP_API_ID_hipMemcpyFromSymbol = HIP_API_ID_NUMBER, + HIP_API_ID_hipMemcpyHtoH = HIP_API_ID_NUMBER, + HIP_API_ID_hipGetTextureReference = HIP_API_ID_NUMBER, + HIP_API_ID_hipDestroyTextureObject = HIP_API_ID_NUMBER, + HIP_API_ID_hipTexRefSetArray = HIP_API_ID_NUMBER, + HIP_API_ID_hipTexRefSetAddress2D = HIP_API_ID_NUMBER, + HIP_API_ID_hipGetTextureObjectResourceViewDesc = HIP_API_ID_NUMBER, + HIP_API_ID_hipUnbindTexture = HIP_API_ID_NUMBER, + HIP_API_ID_hipTexRefSetFilterMode = HIP_API_ID_NUMBER, + HIP_API_ID_hipCreateSurfaceObject = HIP_API_ID_NUMBER, + HIP_API_ID_hipGetChannelDesc = HIP_API_ID_NUMBER, + HIP_API_ID_hipHccGetAcceleratorView = HIP_API_ID_NUMBER, + HIP_API_ID_hipExtModuleLaunchKernel = HIP_API_ID_NUMBER, + HIP_API_ID_hipGetTextureObjectResourceDesc = HIP_API_ID_NUMBER, + HIP_API_ID_hipMemcpyToSymbol = HIP_API_ID_NUMBER, + HIP_API_ID_hipGetTextureAlignmentOffset = HIP_API_ID_NUMBER, + HIP_API_ID_hipTexRefSetFlags = HIP_API_ID_NUMBER, + HIP_API_ID_hipBindTexture = HIP_API_ID_NUMBER, + HIP_API_ID_hipHccGetAccelerator = HIP_API_ID_NUMBER, }; // Return HIP API string static const char* hip_api_name(const uint32_t& id) { switch(id) { - case HIP_API_ID_hipHostFree: return "hipHostFree"; - case HIP_API_ID_hipMemcpyToSymbolAsync: return "hipMemcpyToSymbolAsync"; + case HIP_API_ID_hipStreamCreateWithPriority: return "hipStreamCreateWithPriority"; case HIP_API_ID_hipMallocPitch: return "hipMallocPitch"; case HIP_API_ID_hipMalloc: return "hipMalloc"; - case HIP_API_ID_hipDeviceGetName: return "hipDeviceGetName"; case HIP_API_ID_hipEventRecord: return "hipEventRecord"; case HIP_API_ID_hipCtxSynchronize: return "hipCtxSynchronize"; case HIP_API_ID_hipSetDevice: return "hipSetDevice"; + case HIP_API_ID_hipCtxGetApiVersion: return "hipCtxGetApiVersion"; case HIP_API_ID_hipSetupArgument: return "hipSetupArgument"; - case HIP_API_ID_hipMemcpyFromSymbolAsync: return "hipMemcpyFromSymbolAsync"; case HIP_API_ID_hipMemcpyDtoD: return "hipMemcpyDtoD"; + case HIP_API_ID_hipHostFree: return "hipHostFree"; case HIP_API_ID_hipMemcpy2DToArray: return "hipMemcpy2DToArray"; case HIP_API_ID_hipCtxGetCacheConfig: return "hipCtxGetCacheConfig"; case HIP_API_ID_hipStreamWaitEvent: return "hipStreamWaitEvent"; + case HIP_API_ID_hipDeviceGetStreamPriorityRange: return "hipDeviceGetStreamPriorityRange"; case HIP_API_ID_hipModuleLoad: return "hipModuleLoad"; case HIP_API_ID_hipDevicePrimaryCtxSetFlags: return "hipDevicePrimaryCtxSetFlags"; case HIP_API_ID_hipMemcpyAsync: return "hipMemcpyAsync"; @@ -253,7 +234,6 @@ static const char* hip_api_name(const uint32_t& id) { case HIP_API_ID_hipEventQuery: return "hipEventQuery"; case HIP_API_ID_hipEventCreate: return "hipEventCreate"; case HIP_API_ID_hipMemGetAddressRange: return "hipMemGetAddressRange"; - case HIP_API_ID_hipMemcpyFromSymbol: return "hipMemcpyFromSymbol"; case HIP_API_ID_hipArrayCreate: return "hipArrayCreate"; case HIP_API_ID_hipStreamGetFlags: return "hipStreamGetFlags"; case HIP_API_ID_hipMallocArray: return "hipMallocArray"; @@ -265,6 +245,7 @@ static const char* hip_api_name(const uint32_t& id) { case HIP_API_ID_hipMemcpy3D: return "hipMemcpy3D"; case HIP_API_ID_hipInit: return "hipInit"; case HIP_API_ID_hipMemcpyAtoH: return "hipMemcpyAtoH"; + case HIP_API_ID_hipStreamGetPriority: return "hipStreamGetPriority"; case HIP_API_ID_hipMemset2D: return "hipMemset2D"; case HIP_API_ID_hipMemset2DAsync: return "hipMemset2DAsync"; case HIP_API_ID_hipDeviceCanAccessPeer: return "hipDeviceCanAccessPeer"; @@ -274,12 +255,9 @@ static const char* hip_api_name(const uint32_t& id) { case HIP_API_ID_hipProfilerStop: return "hipProfilerStop"; case HIP_API_ID_hipLaunchByPtr: return "hipLaunchByPtr"; case HIP_API_ID_hipStreamSynchronize: return "hipStreamSynchronize"; - case HIP_API_ID_hipFreeHost: return "hipFreeHost"; - case HIP_API_ID_hipRemoveApiCallback: return "hipRemoveApiCallback"; case HIP_API_ID_hipDeviceSetCacheConfig: return "hipDeviceSetCacheConfig"; - case HIP_API_ID_hipCtxGetApiVersion: return "hipCtxGetApiVersion"; + case HIP_API_ID_hipGetErrorName: return "hipGetErrorName"; case HIP_API_ID_hipMemcpyHtoD: return "hipMemcpyHtoD"; - case HIP_API_ID_hipModuleGetGlobal: return "hipModuleGetGlobal"; case HIP_API_ID_hipMemcpyHtoA: return "hipMemcpyHtoA"; case HIP_API_ID_hipCtxCreate: return "hipCtxCreate"; case HIP_API_ID_hipMemcpy2D: return "hipMemcpy2D"; @@ -287,7 +265,6 @@ static const char* hip_api_name(const uint32_t& id) { case HIP_API_ID_hipChooseDevice: return "hipChooseDevice"; case HIP_API_ID_hipDeviceSetSharedMemConfig: return "hipDeviceSetSharedMemConfig"; case HIP_API_ID_hipDeviceComputeCapability: return "hipDeviceComputeCapability"; - case HIP_API_ID_hipRegisterApiCallback: return "hipRegisterApiCallback"; case HIP_API_ID_hipDeviceGet: return "hipDeviceGet"; case HIP_API_ID_hipProfilerStart: return "hipProfilerStart"; case HIP_API_ID_hipCtxSetCacheConfig: return "hipCtxSetCacheConfig"; @@ -311,8 +288,8 @@ static const char* hip_api_name(const uint32_t& id) { case HIP_API_ID_hipGetLastError: return "hipGetLastError"; case HIP_API_ID_hipCtxDestroy: return "hipCtxDestroy"; case HIP_API_ID_hipDeviceGetSharedMemConfig: return "hipDeviceGetSharedMemConfig"; - case HIP_API_ID_hipRegisterActivityCallback: return "hipRegisterActivityCallback"; case HIP_API_ID_hipSetDeviceFlags: return "hipSetDeviceFlags"; + case HIP_API_ID_hipHccModuleLaunchKernel: return "hipHccModuleLaunchKernel"; case HIP_API_ID_hipFree: return "hipFree"; case HIP_API_ID_hipDeviceGetAttribute: return "hipDeviceGetAttribute"; case HIP_API_ID_hipMemcpyDtoH: return "hipMemcpyDtoH"; @@ -325,27 +302,26 @@ static const char* hip_api_name(const uint32_t& id) { case HIP_API_ID_hipModuleLoadData: return "hipModuleLoadData"; case HIP_API_ID_hipDeviceTotalMem: return "hipDeviceTotalMem"; case HIP_API_ID_hipCtxSetCurrent: return "hipCtxSetCurrent"; - case HIP_API_ID_hipMallocHost: return "hipMallocHost"; + case HIP_API_ID_hipGetErrorString: return "hipGetErrorString"; case HIP_API_ID_hipDevicePrimaryCtxRetain: return "hipDevicePrimaryCtxRetain"; case HIP_API_ID_hipDeviceDisablePeerAccess: return "hipDeviceDisablePeerAccess"; case HIP_API_ID_hipStreamCreateWithFlags: return "hipStreamCreateWithFlags"; case HIP_API_ID_hipMemcpyFromArray: return "hipMemcpyFromArray"; case HIP_API_ID_hipMemcpy2DAsync: return "hipMemcpy2DAsync"; - case HIP_API_ID_hipFuncGetAttributes: return "hipFuncGetAttributes"; case HIP_API_ID_hipEventCreateWithFlags: return "hipEventCreateWithFlags"; case HIP_API_ID_hipStreamQuery: return "hipStreamQuery"; case HIP_API_ID_hipDeviceGetPCIBusId: return "hipDeviceGetPCIBusId"; case HIP_API_ID_hipMemcpy: return "hipMemcpy"; case HIP_API_ID_hipPeekAtLastError: return "hipPeekAtLastError"; - case HIP_API_ID_hipHostAlloc: return "hipHostAlloc"; case HIP_API_ID_hipStreamAddCallback: return "hipStreamAddCallback"; case HIP_API_ID_hipMemcpyToArray: return "hipMemcpyToArray"; + case HIP_API_ID_hipMemsetD32: return "hipMemsetD32"; case HIP_API_ID_hipDeviceSynchronize: return "hipDeviceSynchronize"; case HIP_API_ID_hipDeviceGetCacheConfig: return "hipDeviceGetCacheConfig"; case HIP_API_ID_hipMalloc3D: return "hipMalloc3D"; case HIP_API_ID_hipPointerGetAttributes: return "hipPointerGetAttributes"; case HIP_API_ID_hipMemsetAsync: return "hipMemsetAsync"; - case HIP_API_ID_hipMemcpyToSymbol: return "hipMemcpyToSymbol"; + case HIP_API_ID_hipDeviceGetName: return "hipDeviceGetName"; case HIP_API_ID_hipCtxPushCurrent: return "hipCtxPushCurrent"; case HIP_API_ID_hipMemcpyPeer: return "hipMemcpyPeer"; case HIP_API_ID_hipEventSynchronize: return "hipEventSynchronize"; @@ -354,7 +330,6 @@ static const char* hip_api_name(const uint32_t& id) { case HIP_API_ID_hipMemcpyDtoHAsync: return "hipMemcpyDtoHAsync"; case HIP_API_ID_hipModuleLaunchKernel: return "hipModuleLaunchKernel"; case HIP_API_ID_hipModuleGetTexRef: return "hipModuleGetTexRef"; - case HIP_API_ID_hipRemoveActivityCallback: return "hipRemoveActivityCallback"; case HIP_API_ID_hipDeviceGetLimit: return "hipDeviceGetLimit"; case HIP_API_ID_hipModuleLoadDataEx: return "hipModuleLoadDataEx"; case HIP_API_ID_hipRuntimeGetVersion: return "hipRuntimeGetVersion"; @@ -363,12 +338,10 @@ static const char* hip_api_name(const uint32_t& id) { case HIP_API_ID_hipDevicePrimaryCtxRelease: return "hipDevicePrimaryCtxRelease"; case HIP_API_ID_hipHostGetDevicePointer: return "hipHostGetDevicePointer"; case HIP_API_ID_hipMemcpyParam2D: return "hipMemcpyParam2D"; - case HIP_API_ID_hipConfigureCall: return "hipConfigureCall"; case HIP_API_ID_hipModuleGetFunction: return "hipModuleGetFunction"; + case HIP_API_ID_hipMemsetD32Async: return "hipMemsetD32Async"; case HIP_API_ID_hipGetDevice: return "hipGetDevice"; case HIP_API_ID_hipGetDeviceCount: return "hipGetDeviceCount"; - case HIP_API_ID_hipMemsetD32: return "hipMemsetD32"; - case HIP_API_ID_hipMemsetD32Async: return "hipMemsetD32Async"; }; return "unknown"; }; @@ -379,16 +352,10 @@ struct hip_api_data_t { uint32_t phase; union { struct { - void* ptr; - } hipHostFree; - struct { - const void* symbol_name; - const void* src; - size_t sizeBytes; - size_t offset; - hipMemcpyKind kind; - hipStream_t stream; - } hipMemcpyToSymbolAsync; + hipStream_t* stream; + unsigned int flags; + int priority; + } hipStreamCreateWithPriority; struct { void** ptr; size_t* pitch; @@ -399,11 +366,6 @@ struct hip_api_data_t { void** ptr; size_t size; } hipMalloc; - struct { - char* name; - int len; - hipDevice_t device; - } hipDeviceGetName; struct { hipEvent_t event; hipStream_t stream; @@ -411,24 +373,23 @@ struct hip_api_data_t { struct { int deviceId; } hipSetDevice; + struct { + hipCtx_t ctx; + int* apiVersion; + } hipCtxGetApiVersion; struct { const void* arg; size_t size; size_t offset; } hipSetupArgument; - struct { - void* dst; - const void* symbol_name; - size_t sizeBytes; - size_t offset; - hipMemcpyKind kind; - hipStream_t stream; - } hipMemcpyFromSymbolAsync; struct { hipDeviceptr_t dst; hipDeviceptr_t src; size_t sizeBytes; } hipMemcpyDtoD; + struct { + void* ptr; + } hipHostFree; struct { hipArray* dst; size_t wOffset; @@ -447,6 +408,10 @@ struct hip_api_data_t { hipEvent_t event; unsigned int flags; } hipStreamWaitEvent; + struct { + int* leastPriority; + int* greatestPriority; + } hipDeviceGetStreamPriorityRange; struct { hipModule_t* module; const char* fname; @@ -490,13 +455,6 @@ struct hip_api_data_t { size_t* psize; hipDeviceptr_t dptr; } hipMemGetAddressRange; - struct { - void* dst; - const void* symbol_name; - size_t sizeBytes; - size_t offset; - hipMemcpyKind kind; - } hipMemcpyFromSymbol; struct { hipArray** pHandle; const HIP_ARRAY_DESCRIPTOR* pAllocateArray; @@ -543,6 +501,10 @@ struct hip_api_data_t { size_t srcOffset; size_t count; } hipMemcpyAtoH; + struct { + hipStream_t stream; + int* priority; + } hipStreamGetPriority; struct { void* dst; size_t pitch; @@ -579,30 +541,17 @@ struct hip_api_data_t { struct { hipStream_t stream; } hipStreamSynchronize; - struct { - void* ptr; - } hipFreeHost; - struct { - uint32_t id; - } hipRemoveApiCallback; struct { hipFuncCache_t cacheConfig; } hipDeviceSetCacheConfig; struct { - hipCtx_t ctx; - int* apiVersion; - } hipCtxGetApiVersion; + hipError_t hip_error; + } hipGetErrorName; struct { hipDeviceptr_t dst; void* src; size_t sizeBytes; } hipMemcpyHtoD; - struct { - hipDeviceptr_t* dptr; - size_t* bytes; - hipModule_t hmod; - const char* name; - } hipModuleGetGlobal; struct { hipArray* dstArray; size_t dstOffset; @@ -638,11 +587,6 @@ struct hip_api_data_t { int* minor; hipDevice_t device; } hipDeviceComputeCapability; - struct { - uint32_t id; - void* fun; - void* arg; - } hipRegisterApiCallback; struct { hipDevice_t* device; int ordinal; @@ -726,13 +670,23 @@ struct hip_api_data_t { hipSharedMemConfig* pConfig; } hipDeviceGetSharedMemConfig; struct { - uint32_t id; - void* fun; - void* arg; - } hipRegisterActivityCallback; - struct { - unsigned flags; + unsigned int flags; } hipSetDeviceFlags; + struct { + hipFunction_t f; + unsigned int globalWorkSizeX; + unsigned int globalWorkSizeY; + unsigned int globalWorkSizeZ; + unsigned int localWorkSizeX; + unsigned int localWorkSizeY; + unsigned int localWorkSizeZ; + size_t sharedMemBytes; + hipStream_t hStream; + void** kernelParams; + void** extra; + hipEvent_t startEvent; + hipEvent_t stopEvent; + } hipHccModuleLaunchKernel; struct { void* ptr; } hipFree; @@ -783,9 +737,8 @@ struct hip_api_data_t { hipCtx_t ctx; } hipCtxSetCurrent; struct { - void** ptr; - size_t size; - } hipMallocHost; + hipError_t hipError; + } hipGetErrorString; struct { hipCtx_t* pctx; hipDevice_t dev; @@ -815,13 +768,9 @@ struct hip_api_data_t { hipMemcpyKind kind; hipStream_t stream; } hipMemcpy2DAsync; - struct { - hipFuncAttributes* attr; - const void* func; - } hipFuncGetAttributes; struct { hipEvent_t* event; - unsigned flags; + unsigned int flags; } hipEventCreateWithFlags; struct { hipStream_t stream; @@ -837,11 +786,6 @@ struct hip_api_data_t { size_t sizeBytes; hipMemcpyKind kind; } hipMemcpy; - struct { - void** ptr; - size_t size; - unsigned int flags; - } hipHostAlloc; struct { hipStream_t stream; hipStreamCallback_t callback; @@ -856,6 +800,11 @@ struct hip_api_data_t { size_t count; hipMemcpyKind kind; } hipMemcpyToArray; + struct { + hipDeviceptr_t dest; + int value; + size_t count; + } hipMemsetD32; struct { hipFuncCache_t* cacheConfig; } hipDeviceGetCacheConfig; @@ -874,12 +823,10 @@ struct hip_api_data_t { hipStream_t stream; } hipMemsetAsync; struct { - const void* symbol_name; - const void* src; - size_t sizeBytes; - size_t offset; - hipMemcpyKind kind; - } hipMemcpyToSymbol; + char* name; + int len; + hipDevice_t device; + } hipDeviceGetName; struct { hipCtx_t ctx; } hipCtxPushCurrent; @@ -922,17 +869,11 @@ struct hip_api_data_t { void** kernelParams; void** extra; } hipModuleLaunchKernel; - struct { - hipFunction_t f; - } hipHccModuleLaunchKernel; struct { textureReference** texRef; hipModule_t hmod; const char* name; } hipModuleGetTexRef; - struct { - uint32_t id; - } hipRemoveActivityCallback; struct { size_t* pValue; hipLimit_t limit; @@ -965,666 +906,612 @@ struct hip_api_data_t { struct { const hip_Memcpy2D* pCopy; } hipMemcpyParam2D; - struct { - dim3 gridDim; - dim3 blockDim; - size_t sharedMem; - hipStream_t stream; - } hipConfigureCall; struct { hipFunction_t* function; hipModule_t module; const char* kname; } hipModuleGetFunction; - struct { - int* deviceId; - } hipGetDevice; - struct { - int* count; - } hipGetDeviceCount; - struct { - hipDeviceptr_t dest; - int value; - size_t count; - } hipMemsetD32; struct { hipDeviceptr_t dst; int value; size_t count; hipStream_t stream; } hipMemsetD32Async; + struct { + int* deviceId; + } hipGetDevice; + struct { + int* count; + } hipGetDeviceCount; } args; }; // HIP API callbacks args data filling macros -#define INIT_hipHostFree_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipHostFree.ptr = (void*)ptr; \ -}; -#define INIT_hipMemcpyToSymbolAsync_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyToSymbolAsync.symbol_name = (const void*)symbol_name; \ - cb_data.args.hipMemcpyToSymbolAsync.src = (const void*)src; \ - cb_data.args.hipMemcpyToSymbolAsync.sizeBytes = (size_t)count; \ - cb_data.args.hipMemcpyToSymbolAsync.offset = (size_t)offset; \ - cb_data.args.hipMemcpyToSymbolAsync.kind = (hipMemcpyKind)kind; \ - cb_data.args.hipMemcpyToSymbolAsync.stream = (hipStream_t)stream; \ +#define INIT_hipStreamCreateWithPriority_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipStreamCreateWithPriority.stream = stream; \ + cb_data.args.hipStreamCreateWithPriority.flags = flags; \ + cb_data.args.hipStreamCreateWithPriority.priority = priority; \ }; #define INIT_hipMallocPitch_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMallocPitch.ptr = (void**)ptr; \ - cb_data.args.hipMallocPitch.pitch = (size_t*)pitch; \ - cb_data.args.hipMallocPitch.width = (size_t)width; \ - cb_data.args.hipMallocPitch.height = (size_t)height; \ + cb_data.args.hipMallocPitch.ptr = ptr; \ + cb_data.args.hipMallocPitch.pitch = pitch; \ + cb_data.args.hipMallocPitch.width = width; \ + cb_data.args.hipMallocPitch.height = height; \ }; #define INIT_hipMalloc_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMalloc.ptr = (void**)ptr; \ - cb_data.args.hipMalloc.size = (size_t)sizeBytes; \ -}; -#define INIT_hipDeviceGetName_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceGetName.name = (char*)name; \ - cb_data.args.hipDeviceGetName.len = (int)len; \ - cb_data.args.hipDeviceGetName.device = (hipDevice_t)device; \ + cb_data.args.hipMalloc.ptr = ptr; \ + cb_data.args.hipMalloc.size = sizeBytes; \ }; #define INIT_hipEventRecord_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipEventRecord.event = (hipEvent_t)event; \ - cb_data.args.hipEventRecord.stream = (hipStream_t)stream; \ + cb_data.args.hipEventRecord.event = event; \ + cb_data.args.hipEventRecord.stream = stream; \ }; #define INIT_hipCtxSynchronize_CB_ARGS_DATA(cb_data) { \ }; #define INIT_hipSetDevice_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipSetDevice.deviceId = (int)deviceId; \ + cb_data.args.hipSetDevice.deviceId = deviceId; \ +}; +#define INIT_hipCtxGetApiVersion_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipCtxGetApiVersion.ctx = ctx; \ + cb_data.args.hipCtxGetApiVersion.apiVersion = apiVersion; \ }; #define INIT_hipSetupArgument_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipSetupArgument.arg = (const void*)arg; \ - cb_data.args.hipSetupArgument.size = (size_t)size; \ - cb_data.args.hipSetupArgument.offset = (size_t)offset; \ -}; -#define INIT_hipMemcpyFromSymbolAsync_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyFromSymbolAsync.dst = (void*)dst; \ - cb_data.args.hipMemcpyFromSymbolAsync.symbol_name = (const void*)symbol_name; \ - cb_data.args.hipMemcpyFromSymbolAsync.sizeBytes = (size_t)count; \ - cb_data.args.hipMemcpyFromSymbolAsync.offset = (size_t)offset; \ - cb_data.args.hipMemcpyFromSymbolAsync.kind = (hipMemcpyKind)kind; \ - cb_data.args.hipMemcpyFromSymbolAsync.stream = (hipStream_t)stream; \ + cb_data.args.hipSetupArgument.arg = arg; \ + cb_data.args.hipSetupArgument.size = size; \ + cb_data.args.hipSetupArgument.offset = offset; \ }; #define INIT_hipMemcpyDtoD_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyDtoD.dst = (hipDeviceptr_t)dst; \ - cb_data.args.hipMemcpyDtoD.src = (hipDeviceptr_t)src; \ - cb_data.args.hipMemcpyDtoD.sizeBytes = (size_t)sizeBytes; \ + cb_data.args.hipMemcpyDtoD.dst = dst; \ + cb_data.args.hipMemcpyDtoD.src = src; \ + cb_data.args.hipMemcpyDtoD.sizeBytes = sizeBytes; \ +}; +#define INIT_hipHostFree_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipHostFree.ptr = ptr; \ }; #define INIT_hipMemcpy2DToArray_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpy2DToArray.dst = (hipArray*)dst; \ - cb_data.args.hipMemcpy2DToArray.wOffset = (size_t)wOffset; \ - cb_data.args.hipMemcpy2DToArray.hOffset = (size_t)hOffset; \ - cb_data.args.hipMemcpy2DToArray.src = (const void*)src; \ - cb_data.args.hipMemcpy2DToArray.spitch = (size_t)spitch; \ - cb_data.args.hipMemcpy2DToArray.width = (size_t)width; \ - cb_data.args.hipMemcpy2DToArray.height = (size_t)height; \ - cb_data.args.hipMemcpy2DToArray.kind = (hipMemcpyKind)kind; \ + cb_data.args.hipMemcpy2DToArray.dst = dst; \ + cb_data.args.hipMemcpy2DToArray.wOffset = wOffset; \ + cb_data.args.hipMemcpy2DToArray.hOffset = hOffset; \ + cb_data.args.hipMemcpy2DToArray.src = src; \ + cb_data.args.hipMemcpy2DToArray.spitch = spitch; \ + cb_data.args.hipMemcpy2DToArray.width = width; \ + cb_data.args.hipMemcpy2DToArray.height = height; \ + cb_data.args.hipMemcpy2DToArray.kind = kind; \ }; #define INIT_hipCtxGetCacheConfig_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxGetCacheConfig.cacheConfig = (hipFuncCache_t*)cacheConfig; \ + cb_data.args.hipCtxGetCacheConfig.cacheConfig = cacheConfig; \ }; #define INIT_hipStreamWaitEvent_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipStreamWaitEvent.stream = (hipStream_t)stream; \ - cb_data.args.hipStreamWaitEvent.event = (hipEvent_t)event; \ - cb_data.args.hipStreamWaitEvent.flags = (unsigned int)flags; \ + cb_data.args.hipStreamWaitEvent.stream = stream; \ + cb_data.args.hipStreamWaitEvent.event = event; \ + cb_data.args.hipStreamWaitEvent.flags = flags; \ +}; +#define INIT_hipDeviceGetStreamPriorityRange_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipDeviceGetStreamPriorityRange.leastPriority = leastPriority; \ + cb_data.args.hipDeviceGetStreamPriorityRange.greatestPriority = greatestPriority; \ }; #define INIT_hipModuleLoad_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipModuleLoad.module = (hipModule_t*)module; \ - cb_data.args.hipModuleLoad.fname = (const char*)fname; \ + cb_data.args.hipModuleLoad.module = module; \ + cb_data.args.hipModuleLoad.fname = fname; \ }; #define INIT_hipDevicePrimaryCtxSetFlags_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDevicePrimaryCtxSetFlags.dev = (hipDevice_t)dev; \ - cb_data.args.hipDevicePrimaryCtxSetFlags.flags = (unsigned int)flags; \ + cb_data.args.hipDevicePrimaryCtxSetFlags.dev = dev; \ + cb_data.args.hipDevicePrimaryCtxSetFlags.flags = flags; \ }; #define INIT_hipMemcpyAsync_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyAsync.dst = (void*)dst; \ - cb_data.args.hipMemcpyAsync.src = (const void*)src; \ - cb_data.args.hipMemcpyAsync.sizeBytes = (size_t)sizeBytes; \ - cb_data.args.hipMemcpyAsync.kind = (hipMemcpyKind)kind; \ - cb_data.args.hipMemcpyAsync.stream = (hipStream_t)stream; \ + cb_data.args.hipMemcpyAsync.dst = dst; \ + cb_data.args.hipMemcpyAsync.src = src; \ + cb_data.args.hipMemcpyAsync.sizeBytes = sizeBytes; \ + cb_data.args.hipMemcpyAsync.kind = kind; \ + cb_data.args.hipMemcpyAsync.stream = stream; \ }; #define INIT_hipMalloc3DArray_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMalloc3DArray.array = (hipArray**)array; \ - cb_data.args.hipMalloc3DArray.desc = (const hipChannelFormatDesc*)desc; \ - cb_data.args.hipMalloc3DArray.extent = (hipExtent)extent; \ - cb_data.args.hipMalloc3DArray.flags = (unsigned int)flags; \ + cb_data.args.hipMalloc3DArray.array = array; \ + cb_data.args.hipMalloc3DArray.desc = desc; \ + cb_data.args.hipMalloc3DArray.extent = extent; \ + cb_data.args.hipMalloc3DArray.flags = flags; \ }; #define INIT_hipStreamCreate_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipStreamCreate.stream = (hipStream_t*)stream; \ + cb_data.args.hipStreamCreate.stream = stream; \ }; #define INIT_hipCtxGetCurrent_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxGetCurrent.ctx = (hipCtx_t*)ctx; \ + cb_data.args.hipCtxGetCurrent.ctx = ctx; \ }; #define INIT_hipDevicePrimaryCtxGetState_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDevicePrimaryCtxGetState.dev = (hipDevice_t)dev; \ - cb_data.args.hipDevicePrimaryCtxGetState.flags = (unsigned int*)flags; \ - cb_data.args.hipDevicePrimaryCtxGetState.active = (int*)active; \ + cb_data.args.hipDevicePrimaryCtxGetState.dev = dev; \ + cb_data.args.hipDevicePrimaryCtxGetState.flags = flags; \ + cb_data.args.hipDevicePrimaryCtxGetState.active = active; \ }; #define INIT_hipEventQuery_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipEventQuery.event = (hipEvent_t)event; \ + cb_data.args.hipEventQuery.event = event; \ }; #define INIT_hipEventCreate_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipEventCreate.event = (hipEvent_t*)event; \ + cb_data.args.hipEventCreate.event = event; \ }; #define INIT_hipMemGetAddressRange_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemGetAddressRange.pbase = (hipDeviceptr_t*)pbase; \ - cb_data.args.hipMemGetAddressRange.psize = (size_t*)psize; \ - cb_data.args.hipMemGetAddressRange.dptr = (hipDeviceptr_t)dptr; \ -}; -#define INIT_hipMemcpyFromSymbol_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyFromSymbol.dst = (void*)dst; \ - cb_data.args.hipMemcpyFromSymbol.symbol_name = (const void*)symbol_name; \ - cb_data.args.hipMemcpyFromSymbol.sizeBytes = (size_t)count; \ - cb_data.args.hipMemcpyFromSymbol.offset = (size_t)offset; \ - cb_data.args.hipMemcpyFromSymbol.kind = (hipMemcpyKind)kind; \ + cb_data.args.hipMemGetAddressRange.pbase = pbase; \ + cb_data.args.hipMemGetAddressRange.psize = psize; \ + cb_data.args.hipMemGetAddressRange.dptr = dptr; \ }; #define INIT_hipArrayCreate_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipArrayCreate.pHandle = (hipArray**)array; \ - cb_data.args.hipArrayCreate.pAllocateArray = (const HIP_ARRAY_DESCRIPTOR*)pAllocateArray; \ + cb_data.args.hipArrayCreate.pHandle = array; \ + cb_data.args.hipArrayCreate.pAllocateArray = pAllocateArray; \ }; #define INIT_hipStreamGetFlags_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipStreamGetFlags.stream = (hipStream_t)stream; \ - cb_data.args.hipStreamGetFlags.flags = (unsigned int*)flags; \ + cb_data.args.hipStreamGetFlags.stream = stream; \ + cb_data.args.hipStreamGetFlags.flags = flags; \ }; #define INIT_hipMallocArray_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMallocArray.array = (hipArray**)array; \ - cb_data.args.hipMallocArray.desc = (const hipChannelFormatDesc*)desc; \ - cb_data.args.hipMallocArray.width = (size_t)width; \ - cb_data.args.hipMallocArray.height = (size_t)height; \ - cb_data.args.hipMallocArray.flags = (unsigned int)flags; \ + cb_data.args.hipMallocArray.array = array; \ + cb_data.args.hipMallocArray.desc = desc; \ + cb_data.args.hipMallocArray.width = width; \ + cb_data.args.hipMallocArray.height = height; \ + cb_data.args.hipMallocArray.flags = flags; \ }; #define INIT_hipCtxGetSharedMemConfig_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxGetSharedMemConfig.pConfig = (hipSharedMemConfig*)pConfig; \ + cb_data.args.hipCtxGetSharedMemConfig.pConfig = pConfig; \ }; #define INIT_hipMemPtrGetInfo_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemPtrGetInfo.ptr = (void*)ptr; \ - cb_data.args.hipMemPtrGetInfo.size = (size_t*)size; \ + cb_data.args.hipMemPtrGetInfo.ptr = ptr; \ + cb_data.args.hipMemPtrGetInfo.size = size; \ }; #define INIT_hipCtxGetFlags_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxGetFlags.flags = (unsigned int*)flags; \ + cb_data.args.hipCtxGetFlags.flags = flags; \ }; #define INIT_hipStreamDestroy_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipStreamDestroy.stream = (hipStream_t)stream; \ + cb_data.args.hipStreamDestroy.stream = stream; \ }; #define INIT_hipMemset3DAsync_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemset3DAsync.pitchedDevPtr = (hipPitchedPtr)pitchedDevPtr; \ - cb_data.args.hipMemset3DAsync.value = (int)value; \ - cb_data.args.hipMemset3DAsync.extent = (hipExtent)extent; \ - cb_data.args.hipMemset3DAsync.stream = (hipStream_t)stream; \ + cb_data.args.hipMemset3DAsync.pitchedDevPtr = pitchedDevPtr; \ + cb_data.args.hipMemset3DAsync.value = value; \ + cb_data.args.hipMemset3DAsync.extent = extent; \ + cb_data.args.hipMemset3DAsync.stream = stream; \ }; #define INIT_hipMemcpy3D_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpy3D.p = (const hipMemcpy3DParms*)p; \ + cb_data.args.hipMemcpy3D.p = p; \ }; #define INIT_hipInit_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipInit.flags = (unsigned int)flags; \ + cb_data.args.hipInit.flags = flags; \ }; #define INIT_hipMemcpyAtoH_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyAtoH.dst = (void*)dst; \ - cb_data.args.hipMemcpyAtoH.srcArray = (hipArray*)srcArray; \ - cb_data.args.hipMemcpyAtoH.srcOffset = (size_t)srcOffset; \ - cb_data.args.hipMemcpyAtoH.count = (size_t)count; \ + cb_data.args.hipMemcpyAtoH.dst = dst; \ + cb_data.args.hipMemcpyAtoH.srcArray = srcArray; \ + cb_data.args.hipMemcpyAtoH.srcOffset = srcOffset; \ + cb_data.args.hipMemcpyAtoH.count = count; \ +}; +#define INIT_hipStreamGetPriority_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipStreamGetPriority.stream = stream; \ + cb_data.args.hipStreamGetPriority.priority = priority; \ }; #define INIT_hipMemset2D_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemset2D.dst = (void*)dst; \ - cb_data.args.hipMemset2D.pitch = (size_t)pitch; \ - cb_data.args.hipMemset2D.value = (int)value; \ - cb_data.args.hipMemset2D.width = (size_t)width; \ - cb_data.args.hipMemset2D.height = (size_t)height; \ + cb_data.args.hipMemset2D.dst = dst; \ + cb_data.args.hipMemset2D.pitch = pitch; \ + cb_data.args.hipMemset2D.value = value; \ + cb_data.args.hipMemset2D.width = width; \ + cb_data.args.hipMemset2D.height = height; \ }; #define INIT_hipMemset2DAsync_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemset2DAsync.dst = (void*)dst; \ - cb_data.args.hipMemset2DAsync.pitch = (size_t)pitch; \ - cb_data.args.hipMemset2DAsync.value = (int)value; \ - cb_data.args.hipMemset2DAsync.width = (size_t)width; \ - cb_data.args.hipMemset2DAsync.height = (size_t)height; \ - cb_data.args.hipMemset2DAsync.stream = (hipStream_t)stream; \ + cb_data.args.hipMemset2DAsync.dst = dst; \ + cb_data.args.hipMemset2DAsync.pitch = pitch; \ + cb_data.args.hipMemset2DAsync.value = value; \ + cb_data.args.hipMemset2DAsync.width = width; \ + cb_data.args.hipMemset2DAsync.height = height; \ + cb_data.args.hipMemset2DAsync.stream = stream; \ }; #define INIT_hipDeviceCanAccessPeer_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceCanAccessPeer.canAccessPeer = (int*)canAccessPeer; \ - cb_data.args.hipDeviceCanAccessPeer.deviceId = (int)deviceId; \ - cb_data.args.hipDeviceCanAccessPeer.peerDeviceId = (int)peerDeviceId; \ + cb_data.args.hipDeviceCanAccessPeer.canAccessPeer = canAccessPeer; \ + cb_data.args.hipDeviceCanAccessPeer.deviceId = deviceId; \ + cb_data.args.hipDeviceCanAccessPeer.peerDeviceId = peerDeviceId; \ }; #define INIT_hipDeviceEnablePeerAccess_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceEnablePeerAccess.peerDeviceId = (int)peerDeviceId; \ - cb_data.args.hipDeviceEnablePeerAccess.flags = (unsigned int)flags; \ + cb_data.args.hipDeviceEnablePeerAccess.peerDeviceId = peerDeviceId; \ + cb_data.args.hipDeviceEnablePeerAccess.flags = flags; \ }; #define INIT_hipModuleUnload_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipModuleUnload.module = (hipModule_t)hmod; \ + cb_data.args.hipModuleUnload.module = hmod; \ }; #define INIT_hipHostUnregister_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipHostUnregister.hostPtr = (void*)hostPtr; \ + cb_data.args.hipHostUnregister.hostPtr = hostPtr; \ }; #define INIT_hipProfilerStop_CB_ARGS_DATA(cb_data) { \ }; #define INIT_hipLaunchByPtr_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipLaunchByPtr.func = (const void*)hostFunction; \ + cb_data.args.hipLaunchByPtr.func = hostFunction; \ }; #define INIT_hipStreamSynchronize_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipStreamSynchronize.stream = (hipStream_t)stream; \ -}; -#define INIT_hipFreeHost_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipFreeHost.ptr = (void*)ptr; \ -}; -#define INIT_hipRemoveApiCallback_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipRemoveApiCallback.id = (uint32_t)id; \ + cb_data.args.hipStreamSynchronize.stream = stream; \ }; #define INIT_hipDeviceSetCacheConfig_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceSetCacheConfig.cacheConfig = (hipFuncCache_t)cacheConfig; \ + cb_data.args.hipDeviceSetCacheConfig.cacheConfig = cacheConfig; \ }; -#define INIT_hipCtxGetApiVersion_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxGetApiVersion.ctx = (hipCtx_t)ctx; \ - cb_data.args.hipCtxGetApiVersion.apiVersion = (int*)apiVersion; \ +#define INIT_hipGetErrorName_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipGetErrorName.hip_error = hip_error; \ }; #define INIT_hipMemcpyHtoD_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyHtoD.dst = (hipDeviceptr_t)dst; \ - cb_data.args.hipMemcpyHtoD.src = (void*)src; \ - cb_data.args.hipMemcpyHtoD.sizeBytes = (size_t)sizeBytes; \ -}; -#define INIT_hipModuleGetGlobal_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipModuleGetGlobal.dptr = (hipDeviceptr_t*)dptr; \ - cb_data.args.hipModuleGetGlobal.bytes = (size_t*)bytes; \ - cb_data.args.hipModuleGetGlobal.hmod = (hipModule_t)hmod; \ - cb_data.args.hipModuleGetGlobal.name = (const char*)name; \ + cb_data.args.hipMemcpyHtoD.dst = dst; \ + cb_data.args.hipMemcpyHtoD.src = src; \ + cb_data.args.hipMemcpyHtoD.sizeBytes = sizeBytes; \ }; #define INIT_hipMemcpyHtoA_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyHtoA.dstArray = (hipArray*)dstArray; \ - cb_data.args.hipMemcpyHtoA.dstOffset = (size_t)dstOffset; \ - cb_data.args.hipMemcpyHtoA.srcHost = (const void*)srcHost; \ - cb_data.args.hipMemcpyHtoA.count = (size_t)count; \ + cb_data.args.hipMemcpyHtoA.dstArray = dstArray; \ + cb_data.args.hipMemcpyHtoA.dstOffset = dstOffset; \ + cb_data.args.hipMemcpyHtoA.srcHost = srcHost; \ + cb_data.args.hipMemcpyHtoA.count = count; \ }; #define INIT_hipCtxCreate_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxCreate.ctx = (hipCtx_t*)ctx; \ - cb_data.args.hipCtxCreate.flags = (unsigned int)flags; \ - cb_data.args.hipCtxCreate.device = (hipDevice_t)device; \ + cb_data.args.hipCtxCreate.ctx = ctx; \ + cb_data.args.hipCtxCreate.flags = flags; \ + cb_data.args.hipCtxCreate.device = device; \ }; #define INIT_hipMemcpy2D_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpy2D.dst = (void*)dst; \ - cb_data.args.hipMemcpy2D.dpitch = (size_t)dpitch; \ - cb_data.args.hipMemcpy2D.src = (const void*)src; \ - cb_data.args.hipMemcpy2D.spitch = (size_t)spitch; \ - cb_data.args.hipMemcpy2D.width = (size_t)width; \ - cb_data.args.hipMemcpy2D.height = (size_t)height; \ - cb_data.args.hipMemcpy2D.kind = (hipMemcpyKind)kind; \ + cb_data.args.hipMemcpy2D.dst = dst; \ + cb_data.args.hipMemcpy2D.dpitch = dpitch; \ + cb_data.args.hipMemcpy2D.src = src; \ + cb_data.args.hipMemcpy2D.spitch = spitch; \ + cb_data.args.hipMemcpy2D.width = width; \ + cb_data.args.hipMemcpy2D.height = height; \ + cb_data.args.hipMemcpy2D.kind = kind; \ }; #define INIT_hipIpcCloseMemHandle_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipIpcCloseMemHandle.devPtr = (void*)devPtr; \ + cb_data.args.hipIpcCloseMemHandle.devPtr = devPtr; \ }; #define INIT_hipChooseDevice_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipChooseDevice.device = (int*)device; \ - cb_data.args.hipChooseDevice.prop = (const hipDeviceProp_t*)prop; \ + cb_data.args.hipChooseDevice.device = device; \ + cb_data.args.hipChooseDevice.prop = prop; \ }; #define INIT_hipDeviceSetSharedMemConfig_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceSetSharedMemConfig.config = (hipSharedMemConfig)config; \ + cb_data.args.hipDeviceSetSharedMemConfig.config = config; \ }; #define INIT_hipDeviceComputeCapability_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceComputeCapability.major = (int*)major; \ - cb_data.args.hipDeviceComputeCapability.minor = (int*)minor; \ - cb_data.args.hipDeviceComputeCapability.device = (hipDevice_t)device; \ -}; -#define INIT_hipRegisterApiCallback_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipRegisterApiCallback.id = (uint32_t)id; \ - cb_data.args.hipRegisterApiCallback.fun = (void*)fun; \ - cb_data.args.hipRegisterApiCallback.arg = (void*)arg; \ + cb_data.args.hipDeviceComputeCapability.major = major; \ + cb_data.args.hipDeviceComputeCapability.minor = minor; \ + cb_data.args.hipDeviceComputeCapability.device = device; \ }; #define INIT_hipDeviceGet_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceGet.device = (hipDevice_t*)device; \ - cb_data.args.hipDeviceGet.ordinal = (int)deviceId; \ + cb_data.args.hipDeviceGet.device = device; \ + cb_data.args.hipDeviceGet.ordinal = deviceId; \ }; #define INIT_hipProfilerStart_CB_ARGS_DATA(cb_data) { \ }; #define INIT_hipCtxSetCacheConfig_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxSetCacheConfig.cacheConfig = (hipFuncCache_t)cacheConfig; \ + cb_data.args.hipCtxSetCacheConfig.cacheConfig = cacheConfig; \ }; #define INIT_hipFuncSetCacheConfig_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipFuncSetCacheConfig.func = (const void*)func; \ - cb_data.args.hipFuncSetCacheConfig.config = (hipFuncCache_t)cacheConfig; \ + cb_data.args.hipFuncSetCacheConfig.func = func; \ + cb_data.args.hipFuncSetCacheConfig.config = cacheConfig; \ }; #define INIT_hipMemcpyPeerAsync_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyPeerAsync.dst = (void*)dst; \ - cb_data.args.hipMemcpyPeerAsync.dstDeviceId = (int)dstDevice; \ - cb_data.args.hipMemcpyPeerAsync.src = (const void*)src; \ - cb_data.args.hipMemcpyPeerAsync.srcDevice = (int)srcDevice; \ - cb_data.args.hipMemcpyPeerAsync.sizeBytes = (size_t)sizeBytes; \ - cb_data.args.hipMemcpyPeerAsync.stream = (hipStream_t)stream; \ + cb_data.args.hipMemcpyPeerAsync.dst = dst; \ + cb_data.args.hipMemcpyPeerAsync.dstDeviceId = dstDevice; \ + cb_data.args.hipMemcpyPeerAsync.src = src; \ + cb_data.args.hipMemcpyPeerAsync.srcDevice = srcDevice; \ + cb_data.args.hipMemcpyPeerAsync.sizeBytes = sizeBytes; \ + cb_data.args.hipMemcpyPeerAsync.stream = stream; \ }; #define INIT_hipEventElapsedTime_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipEventElapsedTime.ms = (float*)ms; \ - cb_data.args.hipEventElapsedTime.start = (hipEvent_t)start; \ - cb_data.args.hipEventElapsedTime.stop = (hipEvent_t)stop; \ + cb_data.args.hipEventElapsedTime.ms = ms; \ + cb_data.args.hipEventElapsedTime.start = start; \ + cb_data.args.hipEventElapsedTime.stop = stop; \ }; #define INIT_hipDevicePrimaryCtxReset_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDevicePrimaryCtxReset.dev = (hipDevice_t)dev; \ + cb_data.args.hipDevicePrimaryCtxReset.dev = dev; \ }; #define INIT_hipEventDestroy_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipEventDestroy.event = (hipEvent_t)event; \ + cb_data.args.hipEventDestroy.event = event; \ }; #define INIT_hipCtxPopCurrent_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxPopCurrent.ctx = (hipCtx_t*)ctx; \ + cb_data.args.hipCtxPopCurrent.ctx = ctx; \ }; #define INIT_hipHostGetFlags_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipHostGetFlags.flagsPtr = (unsigned int*)flagsPtr; \ - cb_data.args.hipHostGetFlags.hostPtr = (void*)hostPtr; \ + cb_data.args.hipHostGetFlags.flagsPtr = flagsPtr; \ + cb_data.args.hipHostGetFlags.hostPtr = hostPtr; \ }; #define INIT_hipHostMalloc_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipHostMalloc.ptr = (void**)ptr; \ - cb_data.args.hipHostMalloc.size = (size_t)sizeBytes; \ - cb_data.args.hipHostMalloc.flags = (unsigned int)flags; \ + cb_data.args.hipHostMalloc.ptr = ptr; \ + cb_data.args.hipHostMalloc.size = sizeBytes; \ + cb_data.args.hipHostMalloc.flags = flags; \ }; #define INIT_hipDriverGetVersion_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDriverGetVersion.driverVersion = (int*)driverVersion; \ + cb_data.args.hipDriverGetVersion.driverVersion = driverVersion; \ }; #define INIT_hipMemGetInfo_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemGetInfo.free = (size_t*)free; \ - cb_data.args.hipMemGetInfo.total = (size_t*)total; \ + cb_data.args.hipMemGetInfo.free = free; \ + cb_data.args.hipMemGetInfo.total = total; \ }; #define INIT_hipDeviceReset_CB_ARGS_DATA(cb_data) { \ }; #define INIT_hipMemset_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemset.dst = (void*)dst; \ - cb_data.args.hipMemset.value = (int)value; \ - cb_data.args.hipMemset.sizeBytes = (size_t)sizeBytes; \ + cb_data.args.hipMemset.dst = dst; \ + cb_data.args.hipMemset.value = value; \ + cb_data.args.hipMemset.sizeBytes = sizeBytes; \ }; #define INIT_hipMemsetD8_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemsetD8.dest = (hipDeviceptr_t)dst; \ - cb_data.args.hipMemsetD8.value = (unsigned char)value; \ - cb_data.args.hipMemsetD8.sizeBytes = (size_t)sizeBytes; \ + cb_data.args.hipMemsetD8.dest = dst; \ + cb_data.args.hipMemsetD8.value = value; \ + cb_data.args.hipMemsetD8.sizeBytes = sizeBytes; \ }; #define INIT_hipHostRegister_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipHostRegister.hostPtr = (void*)hostPtr; \ - cb_data.args.hipHostRegister.sizeBytes = (size_t)sizeBytes; \ - cb_data.args.hipHostRegister.flags = (unsigned int)flags; \ + cb_data.args.hipHostRegister.hostPtr = hostPtr; \ + cb_data.args.hipHostRegister.sizeBytes = sizeBytes; \ + cb_data.args.hipHostRegister.flags = flags; \ }; #define INIT_hipCtxSetSharedMemConfig_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxSetSharedMemConfig.config = (hipSharedMemConfig)config; \ + cb_data.args.hipCtxSetSharedMemConfig.config = config; \ }; #define INIT_hipArray3DCreate_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipArray3DCreate.array = (hipArray**)array; \ - cb_data.args.hipArray3DCreate.pAllocateArray = (const HIP_ARRAY_DESCRIPTOR*)pAllocateArray; \ + cb_data.args.hipArray3DCreate.array = array; \ + cb_data.args.hipArray3DCreate.pAllocateArray = pAllocateArray; \ }; #define INIT_hipIpcOpenMemHandle_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipIpcOpenMemHandle.devPtr = (void**)devPtr; \ - cb_data.args.hipIpcOpenMemHandle.handle = (hipIpcMemHandle_t)handle; \ - cb_data.args.hipIpcOpenMemHandle.flags = (unsigned int)flags; \ + cb_data.args.hipIpcOpenMemHandle.devPtr = devPtr; \ + cb_data.args.hipIpcOpenMemHandle.handle = handle; \ + cb_data.args.hipIpcOpenMemHandle.flags = flags; \ }; #define INIT_hipGetLastError_CB_ARGS_DATA(cb_data) { \ }; #define INIT_hipCtxDestroy_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxDestroy.ctx = (hipCtx_t)ctx; \ + cb_data.args.hipCtxDestroy.ctx = ctx; \ }; #define INIT_hipDeviceGetSharedMemConfig_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceGetSharedMemConfig.pConfig = (hipSharedMemConfig*)pConfig; \ -}; -#define INIT_hipRegisterActivityCallback_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipRegisterActivityCallback.id = (uint32_t)id; \ - cb_data.args.hipRegisterActivityCallback.fun = (void*)fun; \ - cb_data.args.hipRegisterActivityCallback.arg = (void*)arg; \ + cb_data.args.hipDeviceGetSharedMemConfig.pConfig = pConfig; \ }; #define INIT_hipSetDeviceFlags_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipSetDeviceFlags.flags = (unsigned)flags; \ + cb_data.args.hipSetDeviceFlags.flags = flags; \ +}; +#define INIT_hipHccModuleLaunchKernel_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipHccModuleLaunchKernel.f = f; \ + cb_data.args.hipHccModuleLaunchKernel.globalWorkSizeX = globalWorkSizeX; \ + cb_data.args.hipHccModuleLaunchKernel.globalWorkSizeY = globalWorkSizeY; \ + cb_data.args.hipHccModuleLaunchKernel.globalWorkSizeZ = globalWorkSizeZ; \ + cb_data.args.hipHccModuleLaunchKernel.localWorkSizeX = localWorkSizeX; \ + cb_data.args.hipHccModuleLaunchKernel.localWorkSizeY = localWorkSizeY; \ + cb_data.args.hipHccModuleLaunchKernel.localWorkSizeZ = localWorkSizeZ; \ + cb_data.args.hipHccModuleLaunchKernel.sharedMemBytes = sharedMemBytes; \ + cb_data.args.hipHccModuleLaunchKernel.hStream = hStream; \ + cb_data.args.hipHccModuleLaunchKernel.kernelParams = kernelParams; \ + cb_data.args.hipHccModuleLaunchKernel.extra = extra; \ + cb_data.args.hipHccModuleLaunchKernel.startEvent = startEvent; \ + cb_data.args.hipHccModuleLaunchKernel.stopEvent = stopEvent; \ }; #define INIT_hipFree_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipFree.ptr = (void*)ptr; \ + cb_data.args.hipFree.ptr = ptr; \ }; #define INIT_hipDeviceGetAttribute_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceGetAttribute.pi = (int*)pi; \ - cb_data.args.hipDeviceGetAttribute.attr = (hipDeviceAttribute_t)attr; \ - cb_data.args.hipDeviceGetAttribute.deviceId = (int)device; \ + cb_data.args.hipDeviceGetAttribute.pi = pi; \ + cb_data.args.hipDeviceGetAttribute.attr = attr; \ + cb_data.args.hipDeviceGetAttribute.deviceId = device; \ }; #define INIT_hipMemcpyDtoH_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyDtoH.dst = (void*)dst; \ - cb_data.args.hipMemcpyDtoH.src = (hipDeviceptr_t)src; \ - cb_data.args.hipMemcpyDtoH.sizeBytes = (size_t)sizeBytes; \ + cb_data.args.hipMemcpyDtoH.dst = dst; \ + cb_data.args.hipMemcpyDtoH.src = src; \ + cb_data.args.hipMemcpyDtoH.sizeBytes = sizeBytes; \ }; #define INIT_hipCtxDisablePeerAccess_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxDisablePeerAccess.peerCtx = (hipCtx_t)peerCtx; \ + cb_data.args.hipCtxDisablePeerAccess.peerCtx = peerCtx; \ }; #define INIT_hipDeviceGetByPCIBusId_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceGetByPCIBusId.device = (int*)device; \ - cb_data.args.hipDeviceGetByPCIBusId.pciBusId = (const char*)pciBusId; \ + cb_data.args.hipDeviceGetByPCIBusId.device = device; \ + cb_data.args.hipDeviceGetByPCIBusId.pciBusId = pciBusId; \ }; #define INIT_hipIpcGetMemHandle_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipIpcGetMemHandle.handle = (hipIpcMemHandle_t*)handle; \ - cb_data.args.hipIpcGetMemHandle.devPtr = (void*)devPtr; \ + cb_data.args.hipIpcGetMemHandle.handle = handle; \ + cb_data.args.hipIpcGetMemHandle.devPtr = devPtr; \ }; #define INIT_hipMemcpyHtoDAsync_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyHtoDAsync.dst = (hipDeviceptr_t)dst; \ - cb_data.args.hipMemcpyHtoDAsync.src = (void*)src; \ - cb_data.args.hipMemcpyHtoDAsync.sizeBytes = (size_t)sizeBytes; \ - cb_data.args.hipMemcpyHtoDAsync.stream = (hipStream_t)stream; \ + cb_data.args.hipMemcpyHtoDAsync.dst = dst; \ + cb_data.args.hipMemcpyHtoDAsync.src = src; \ + cb_data.args.hipMemcpyHtoDAsync.sizeBytes = sizeBytes; \ + cb_data.args.hipMemcpyHtoDAsync.stream = stream; \ }; #define INIT_hipCtxGetDevice_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxGetDevice.device = (hipDevice_t*)device; \ + cb_data.args.hipCtxGetDevice.device = device; \ }; #define INIT_hipMemset3D_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemset3D.pitchedDevPtr = (hipPitchedPtr)pitchedDevPtr; \ - cb_data.args.hipMemset3D.value = (int)value; \ - cb_data.args.hipMemset3D.extent = (hipExtent)extent; \ + cb_data.args.hipMemset3D.pitchedDevPtr = pitchedDevPtr; \ + cb_data.args.hipMemset3D.value = value; \ + cb_data.args.hipMemset3D.extent = extent; \ }; #define INIT_hipModuleLoadData_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipModuleLoadData.module = (hipModule_t*)module; \ - cb_data.args.hipModuleLoadData.image = (const void*)image; \ + cb_data.args.hipModuleLoadData.module = module; \ + cb_data.args.hipModuleLoadData.image = image; \ }; #define INIT_hipDeviceTotalMem_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceTotalMem.bytes = (size_t*)bytes; \ - cb_data.args.hipDeviceTotalMem.device = (hipDevice_t)device; \ + cb_data.args.hipDeviceTotalMem.bytes = bytes; \ + cb_data.args.hipDeviceTotalMem.device = device; \ }; #define INIT_hipCtxSetCurrent_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxSetCurrent.ctx = (hipCtx_t)ctx; \ + cb_data.args.hipCtxSetCurrent.ctx = ctx; \ }; -#define INIT_hipMallocHost_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMallocHost.ptr = (void**)ptr; \ - cb_data.args.hipMallocHost.size = (size_t)sizeBytes; \ +#define INIT_hipGetErrorString_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipGetErrorString.hipError = hip_error; \ }; #define INIT_hipDevicePrimaryCtxRetain_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDevicePrimaryCtxRetain.pctx = (hipCtx_t*)pctx; \ - cb_data.args.hipDevicePrimaryCtxRetain.dev = (hipDevice_t)dev; \ + cb_data.args.hipDevicePrimaryCtxRetain.pctx = pctx; \ + cb_data.args.hipDevicePrimaryCtxRetain.dev = dev; \ }; #define INIT_hipDeviceDisablePeerAccess_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceDisablePeerAccess.peerDeviceId = (int)peerDeviceId; \ + cb_data.args.hipDeviceDisablePeerAccess.peerDeviceId = peerDeviceId; \ }; #define INIT_hipStreamCreateWithFlags_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipStreamCreateWithFlags.stream = (hipStream_t*)stream; \ - cb_data.args.hipStreamCreateWithFlags.flags = (unsigned int)flags; \ + cb_data.args.hipStreamCreateWithFlags.stream = stream; \ + cb_data.args.hipStreamCreateWithFlags.flags = flags; \ }; #define INIT_hipMemcpyFromArray_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyFromArray.dst = (void*)dst; \ - cb_data.args.hipMemcpyFromArray.srcArray = (hipArray_const_t)srcArray; \ - cb_data.args.hipMemcpyFromArray.wOffset = (size_t)wOffset; \ - cb_data.args.hipMemcpyFromArray.hOffset = (size_t)hOffset; \ - cb_data.args.hipMemcpyFromArray.count = (size_t)count; \ - cb_data.args.hipMemcpyFromArray.kind = (hipMemcpyKind)kind; \ + cb_data.args.hipMemcpyFromArray.dst = dst; \ + cb_data.args.hipMemcpyFromArray.srcArray = srcArray; \ + cb_data.args.hipMemcpyFromArray.wOffset = wOffset; \ + cb_data.args.hipMemcpyFromArray.hOffset = hOffset; \ + cb_data.args.hipMemcpyFromArray.count = count; \ + cb_data.args.hipMemcpyFromArray.kind = kind; \ }; #define INIT_hipMemcpy2DAsync_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpy2DAsync.dst = (void*)dst; \ - cb_data.args.hipMemcpy2DAsync.dpitch = (size_t)dpitch; \ - cb_data.args.hipMemcpy2DAsync.src = (const void*)src; \ - cb_data.args.hipMemcpy2DAsync.spitch = (size_t)spitch; \ - cb_data.args.hipMemcpy2DAsync.width = (size_t)width; \ - cb_data.args.hipMemcpy2DAsync.height = (size_t)height; \ - cb_data.args.hipMemcpy2DAsync.kind = (hipMemcpyKind)kind; \ - cb_data.args.hipMemcpy2DAsync.stream = (hipStream_t)stream; \ -}; -#define INIT_hipFuncGetAttributes_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipFuncGetAttributes.attr = (hipFuncAttributes*)attr; \ - cb_data.args.hipFuncGetAttributes.func = (const void*)func; \ + cb_data.args.hipMemcpy2DAsync.dst = dst; \ + cb_data.args.hipMemcpy2DAsync.dpitch = dpitch; \ + cb_data.args.hipMemcpy2DAsync.src = src; \ + cb_data.args.hipMemcpy2DAsync.spitch = spitch; \ + cb_data.args.hipMemcpy2DAsync.width = width; \ + cb_data.args.hipMemcpy2DAsync.height = height; \ + cb_data.args.hipMemcpy2DAsync.kind = kind; \ + cb_data.args.hipMemcpy2DAsync.stream = stream; \ }; #define INIT_hipEventCreateWithFlags_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipEventCreateWithFlags.event = (hipEvent_t*)event; \ - cb_data.args.hipEventCreateWithFlags.flags = (unsigned)flags; \ + cb_data.args.hipEventCreateWithFlags.event = event; \ + cb_data.args.hipEventCreateWithFlags.flags = flags; \ }; #define INIT_hipStreamQuery_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipStreamQuery.stream = (hipStream_t)stream; \ + cb_data.args.hipStreamQuery.stream = stream; \ }; #define INIT_hipDeviceGetPCIBusId_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceGetPCIBusId.pciBusId = (char*)pciBusId; \ - cb_data.args.hipDeviceGetPCIBusId.len = (int)len; \ - cb_data.args.hipDeviceGetPCIBusId.device = (int)device; \ + cb_data.args.hipDeviceGetPCIBusId.pciBusId = pciBusId; \ + cb_data.args.hipDeviceGetPCIBusId.len = len; \ + cb_data.args.hipDeviceGetPCIBusId.device = device; \ }; #define INIT_hipMemcpy_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpy.dst = (void*)dst; \ - cb_data.args.hipMemcpy.src = (const void*)src; \ - cb_data.args.hipMemcpy.sizeBytes = (size_t)sizeBytes; \ - cb_data.args.hipMemcpy.kind = (hipMemcpyKind)kind; \ + cb_data.args.hipMemcpy.dst = dst; \ + cb_data.args.hipMemcpy.src = src; \ + cb_data.args.hipMemcpy.sizeBytes = sizeBytes; \ + cb_data.args.hipMemcpy.kind = kind; \ }; #define INIT_hipPeekAtLastError_CB_ARGS_DATA(cb_data) { \ }; -#define INIT_hipHostAlloc_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipHostAlloc.ptr = (void**)ptr; \ - cb_data.args.hipHostAlloc.size = (size_t)sizeBytes; \ - cb_data.args.hipHostAlloc.flags = (unsigned int)flags; \ -}; #define INIT_hipStreamAddCallback_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipStreamAddCallback.stream = (hipStream_t)stream; \ - cb_data.args.hipStreamAddCallback.callback = (hipStreamCallback_t)callback; \ - cb_data.args.hipStreamAddCallback.userData = (void*)userData; \ - cb_data.args.hipStreamAddCallback.flags = (unsigned int)flags; \ + cb_data.args.hipStreamAddCallback.stream = stream; \ + cb_data.args.hipStreamAddCallback.callback = callback; \ + cb_data.args.hipStreamAddCallback.userData = userData; \ + cb_data.args.hipStreamAddCallback.flags = flags; \ }; #define INIT_hipMemcpyToArray_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyToArray.dst = (hipArray*)dst; \ - cb_data.args.hipMemcpyToArray.wOffset = (size_t)wOffset; \ - cb_data.args.hipMemcpyToArray.hOffset = (size_t)hOffset; \ - cb_data.args.hipMemcpyToArray.src = (const void*)src; \ - cb_data.args.hipMemcpyToArray.count = (size_t)count; \ - cb_data.args.hipMemcpyToArray.kind = (hipMemcpyKind)kind; \ + cb_data.args.hipMemcpyToArray.dst = dst; \ + cb_data.args.hipMemcpyToArray.wOffset = wOffset; \ + cb_data.args.hipMemcpyToArray.hOffset = hOffset; \ + cb_data.args.hipMemcpyToArray.src = src; \ + cb_data.args.hipMemcpyToArray.count = count; \ + cb_data.args.hipMemcpyToArray.kind = kind; \ +}; +#define INIT_hipMemsetD32_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipMemsetD32.dest = dst; \ + cb_data.args.hipMemsetD32.value = value; \ + cb_data.args.hipMemsetD32.count = count; \ }; #define INIT_hipDeviceSynchronize_CB_ARGS_DATA(cb_data) { \ }; #define INIT_hipDeviceGetCacheConfig_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceGetCacheConfig.cacheConfig = (hipFuncCache_t*)cacheConfig; \ + cb_data.args.hipDeviceGetCacheConfig.cacheConfig = cacheConfig; \ }; #define INIT_hipMalloc3D_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMalloc3D.pitchedDevPtr = (hipPitchedPtr*)pitchedDevPtr; \ - cb_data.args.hipMalloc3D.extent = (hipExtent)extent; \ + cb_data.args.hipMalloc3D.pitchedDevPtr = pitchedDevPtr; \ + cb_data.args.hipMalloc3D.extent = extent; \ }; #define INIT_hipPointerGetAttributes_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipPointerGetAttributes.attributes = (hipPointerAttribute_t*)attributes; \ - cb_data.args.hipPointerGetAttributes.ptr = (const void*)ptr; \ + cb_data.args.hipPointerGetAttributes.attributes = attributes; \ + cb_data.args.hipPointerGetAttributes.ptr = ptr; \ }; #define INIT_hipMemsetAsync_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemsetAsync.dst = (void*)dst; \ - cb_data.args.hipMemsetAsync.value = (int)value; \ - cb_data.args.hipMemsetAsync.sizeBytes = (size_t)sizeBytes; \ - cb_data.args.hipMemsetAsync.stream = (hipStream_t)stream; \ + cb_data.args.hipMemsetAsync.dst = dst; \ + cb_data.args.hipMemsetAsync.value = value; \ + cb_data.args.hipMemsetAsync.sizeBytes = sizeBytes; \ + cb_data.args.hipMemsetAsync.stream = stream; \ }; -#define INIT_hipMemcpyToSymbol_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyToSymbol.symbol_name = (const void*)symbol_name; \ - cb_data.args.hipMemcpyToSymbol.src = (const void*)src; \ - cb_data.args.hipMemcpyToSymbol.sizeBytes = (size_t)count; \ - cb_data.args.hipMemcpyToSymbol.offset = (size_t)offset; \ - cb_data.args.hipMemcpyToSymbol.kind = (hipMemcpyKind)kind; \ +#define INIT_hipDeviceGetName_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipDeviceGetName.name = name; \ + cb_data.args.hipDeviceGetName.len = len; \ + cb_data.args.hipDeviceGetName.device = device; \ }; #define INIT_hipCtxPushCurrent_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxPushCurrent.ctx = (hipCtx_t)ctx; \ + cb_data.args.hipCtxPushCurrent.ctx = ctx; \ }; #define INIT_hipMemcpyPeer_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyPeer.dst = (void*)dst; \ - cb_data.args.hipMemcpyPeer.dstDeviceId = (int)dstDevice; \ - cb_data.args.hipMemcpyPeer.src = (const void*)src; \ - cb_data.args.hipMemcpyPeer.srcDeviceId = (int)srcDevice; \ - cb_data.args.hipMemcpyPeer.sizeBytes = (size_t)sizeBytes; \ + cb_data.args.hipMemcpyPeer.dst = dst; \ + cb_data.args.hipMemcpyPeer.dstDeviceId = dstDevice; \ + cb_data.args.hipMemcpyPeer.src = src; \ + cb_data.args.hipMemcpyPeer.srcDeviceId = srcDevice; \ + cb_data.args.hipMemcpyPeer.sizeBytes = sizeBytes; \ }; #define INIT_hipEventSynchronize_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipEventSynchronize.event = (hipEvent_t)event; \ + cb_data.args.hipEventSynchronize.event = event; \ }; #define INIT_hipMemcpyDtoDAsync_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyDtoDAsync.dst = (hipDeviceptr_t)dst; \ - cb_data.args.hipMemcpyDtoDAsync.src = (hipDeviceptr_t)src; \ - cb_data.args.hipMemcpyDtoDAsync.sizeBytes = (size_t)sizeBytes; \ - cb_data.args.hipMemcpyDtoDAsync.stream = (hipStream_t)stream; \ + cb_data.args.hipMemcpyDtoDAsync.dst = dst; \ + cb_data.args.hipMemcpyDtoDAsync.src = src; \ + cb_data.args.hipMemcpyDtoDAsync.sizeBytes = sizeBytes; \ + cb_data.args.hipMemcpyDtoDAsync.stream = stream; \ }; #define INIT_hipCtxEnablePeerAccess_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipCtxEnablePeerAccess.peerCtx = (hipCtx_t)peerCtx; \ - cb_data.args.hipCtxEnablePeerAccess.flags = (unsigned int)flags; \ + cb_data.args.hipCtxEnablePeerAccess.peerCtx = peerCtx; \ + cb_data.args.hipCtxEnablePeerAccess.flags = flags; \ }; #define INIT_hipMemcpyDtoHAsync_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyDtoHAsync.dst = (void*)dst; \ - cb_data.args.hipMemcpyDtoHAsync.src = (hipDeviceptr_t)src; \ - cb_data.args.hipMemcpyDtoHAsync.sizeBytes = (size_t)sizeBytes; \ - cb_data.args.hipMemcpyDtoHAsync.stream = (hipStream_t)stream; \ + cb_data.args.hipMemcpyDtoHAsync.dst = dst; \ + cb_data.args.hipMemcpyDtoHAsync.src = src; \ + cb_data.args.hipMemcpyDtoHAsync.sizeBytes = sizeBytes; \ + cb_data.args.hipMemcpyDtoHAsync.stream = stream; \ }; #define INIT_hipModuleLaunchKernel_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipModuleLaunchKernel.f = (hipFunction_t)f; \ - cb_data.args.hipModuleLaunchKernel.gridDimX = (unsigned int)gridDimX; \ - cb_data.args.hipModuleLaunchKernel.gridDimY = (unsigned int)gridDimY; \ - cb_data.args.hipModuleLaunchKernel.gridDimZ = (unsigned int)gridDimZ; \ - cb_data.args.hipModuleLaunchKernel.blockDimX = (unsigned int)blockDimX; \ - cb_data.args.hipModuleLaunchKernel.blockDimY = (unsigned int)blockDimY; \ - cb_data.args.hipModuleLaunchKernel.blockDimZ = (unsigned int)blockDimZ; \ - cb_data.args.hipModuleLaunchKernel.sharedMemBytes = (unsigned int)sharedMemBytes; \ - cb_data.args.hipModuleLaunchKernel.stream = (hipStream_t)hStream; \ - cb_data.args.hipModuleLaunchKernel.kernelParams = (void**)kernelParams; \ - cb_data.args.hipModuleLaunchKernel.extra = (void**)extra; \ -}; -#define INIT_hipHccModuleLaunchKernel_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipModuleLaunchKernel.f = (hipFunction_t)f; \ + cb_data.args.hipModuleLaunchKernel.f = f; \ + cb_data.args.hipModuleLaunchKernel.gridDimX = gridDimX; \ + cb_data.args.hipModuleLaunchKernel.gridDimY = gridDimY; \ + cb_data.args.hipModuleLaunchKernel.gridDimZ = gridDimZ; \ + cb_data.args.hipModuleLaunchKernel.blockDimX = blockDimX; \ + cb_data.args.hipModuleLaunchKernel.blockDimY = blockDimY; \ + cb_data.args.hipModuleLaunchKernel.blockDimZ = blockDimZ; \ + cb_data.args.hipModuleLaunchKernel.sharedMemBytes = sharedMemBytes; \ + cb_data.args.hipModuleLaunchKernel.stream = hStream; \ + cb_data.args.hipModuleLaunchKernel.kernelParams = kernelParams; \ + cb_data.args.hipModuleLaunchKernel.extra = extra; \ }; #define INIT_hipModuleGetTexRef_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipModuleGetTexRef.texRef = (textureReference**)texRef; \ - cb_data.args.hipModuleGetTexRef.hmod = (hipModule_t)hmod; \ - cb_data.args.hipModuleGetTexRef.name = (const char*)name; \ -}; -#define INIT_hipRemoveActivityCallback_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipRemoveActivityCallback.id = (uint32_t)id; \ + cb_data.args.hipModuleGetTexRef.texRef = texRef; \ + cb_data.args.hipModuleGetTexRef.hmod = hmod; \ + cb_data.args.hipModuleGetTexRef.name = name; \ }; #define INIT_hipDeviceGetLimit_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDeviceGetLimit.pValue = (size_t*)pValue; \ - cb_data.args.hipDeviceGetLimit.limit = (hipLimit_t)limit; \ + cb_data.args.hipDeviceGetLimit.pValue = pValue; \ + cb_data.args.hipDeviceGetLimit.limit = limit; \ }; #define INIT_hipModuleLoadDataEx_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipModuleLoadDataEx.module = (hipModule_t*)module; \ - cb_data.args.hipModuleLoadDataEx.image = (const void*)image; \ - cb_data.args.hipModuleLoadDataEx.numOptions = (unsigned int)numOptions; \ - cb_data.args.hipModuleLoadDataEx.options = (hipJitOption*)options; \ - cb_data.args.hipModuleLoadDataEx.optionValues = (void**)optionValues; \ + cb_data.args.hipModuleLoadDataEx.module = module; \ + cb_data.args.hipModuleLoadDataEx.image = image; \ + cb_data.args.hipModuleLoadDataEx.numOptions = numOptions; \ + cb_data.args.hipModuleLoadDataEx.options = options; \ + cb_data.args.hipModuleLoadDataEx.optionValues = optionValues; \ }; #define INIT_hipRuntimeGetVersion_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipRuntimeGetVersion.runtimeVersion = (int*)runtimeVersion; \ + cb_data.args.hipRuntimeGetVersion.runtimeVersion = runtimeVersion; \ }; #define INIT_hipGetDeviceProperties_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipGetDeviceProperties.prop = (hipDeviceProp_t*)props; \ - cb_data.args.hipGetDeviceProperties.deviceId = (int)device; \ + cb_data.args.hipGetDeviceProperties.prop = props; \ + cb_data.args.hipGetDeviceProperties.deviceId = device; \ }; #define INIT_hipFreeArray_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipFreeArray.array = (hipArray*)array; \ + cb_data.args.hipFreeArray.array = array; \ }; #define INIT_hipDevicePrimaryCtxRelease_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipDevicePrimaryCtxRelease.dev = (hipDevice_t)dev; \ + cb_data.args.hipDevicePrimaryCtxRelease.dev = dev; \ }; #define INIT_hipHostGetDevicePointer_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipHostGetDevicePointer.devPtr = (void**)devicePointer; \ - cb_data.args.hipHostGetDevicePointer.hstPtr = (void*)hostPointer; \ - cb_data.args.hipHostGetDevicePointer.flags = (unsigned int)flags; \ + cb_data.args.hipHostGetDevicePointer.devPtr = devicePointer; \ + cb_data.args.hipHostGetDevicePointer.hstPtr = hostPointer; \ + cb_data.args.hipHostGetDevicePointer.flags = flags; \ }; #define INIT_hipMemcpyParam2D_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemcpyParam2D.pCopy = (const hip_Memcpy2D*)pCopy; \ -}; -#define INIT_hipConfigureCall_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipConfigureCall.gridDim = (dim3)gridDim; \ - cb_data.args.hipConfigureCall.blockDim = (dim3)blockDim; \ - cb_data.args.hipConfigureCall.sharedMem = (size_t)sharedMem; \ - cb_data.args.hipConfigureCall.stream = (hipStream_t)stream; \ + cb_data.args.hipMemcpyParam2D.pCopy = pCopy; \ }; #define INIT_hipModuleGetFunction_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipModuleGetFunction.function = (hipFunction_t*)hfunc; \ - cb_data.args.hipModuleGetFunction.module = (hipModule_t)hmod; \ - cb_data.args.hipModuleGetFunction.kname = (const char*)name; \ -}; -#define INIT_hipGetDevice_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipGetDevice.deviceId = (int*)deviceId; \ -}; -#define INIT_hipGetDeviceCount_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipGetDeviceCount.count = (int*)count; \ -}; -#define INIT_hipMemsetD32_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemsetD32.dest = (hipDeviceptr_t)dst; \ - cb_data.args.hipMemsetD32.value = (int)value; \ - cb_data.args.hipMemsetD32.count = (size_t)count; \ + cb_data.args.hipModuleGetFunction.function = hfunc; \ + cb_data.args.hipModuleGetFunction.module = hmod; \ + cb_data.args.hipModuleGetFunction.kname = name; \ }; #define INIT_hipMemsetD32Async_CB_ARGS_DATA(cb_data) { \ - cb_data.args.hipMemsetD32Async.dst = (hipDeviceptr_t)dst; \ - cb_data.args.hipMemsetD32Async.value = (int)value; \ - cb_data.args.hipMemsetD32Async.count = (size_t)count; \ - cb_data.args.hipMemsetD32Async.stream = (hipStream_t)stream; \ + cb_data.args.hipMemsetD32Async.dst = dst; \ + cb_data.args.hipMemsetD32Async.value = value; \ + cb_data.args.hipMemsetD32Async.count = count; \ + cb_data.args.hipMemsetD32Async.stream = stream; \ +}; +#define INIT_hipGetDevice_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipGetDevice.deviceId = deviceId; \ +}; +#define INIT_hipGetDeviceCount_CB_ARGS_DATA(cb_data) { \ + cb_data.args.hipGetDeviceCount.count = count; \ }; #define INIT_CB_ARGS_DATA(cb_id, cb_data) INIT_##cb_id##_CB_ARGS_DATA(cb_data) @@ -1633,19 +1520,11 @@ struct hip_api_data_t { const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { std::ostringstream oss; switch (id) { - case HIP_API_ID_hipHostFree: - oss << "hipHostFree(" - << " ptr=" << data->args.hipHostFree.ptr - << ")"; - break; - case HIP_API_ID_hipMemcpyToSymbolAsync: - oss << "hipMemcpyToSymbolAsync(" - << " symbol_name=" << data->args.hipMemcpyToSymbolAsync.symbol_name << "," - << " src=" << data->args.hipMemcpyToSymbolAsync.src << "," - << " sizeBytes=" << data->args.hipMemcpyToSymbolAsync.sizeBytes << "," - << " offset=" << data->args.hipMemcpyToSymbolAsync.offset << "," - << " kind=" << data->args.hipMemcpyToSymbolAsync.kind << "," - << " stream=" << data->args.hipMemcpyToSymbolAsync.stream + case HIP_API_ID_hipStreamCreateWithPriority: + oss << "hipStreamCreateWithPriority(" + << " stream=" << data->args.hipStreamCreateWithPriority.stream << "," + << " flags=" << data->args.hipStreamCreateWithPriority.flags << "," + << " priority=" << data->args.hipStreamCreateWithPriority.priority << ")"; break; case HIP_API_ID_hipMallocPitch: @@ -1662,13 +1541,6 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " size=" << data->args.hipMalloc.size << ")"; break; - case HIP_API_ID_hipDeviceGetName: - oss << "hipDeviceGetName(" - << " name=" << data->args.hipDeviceGetName.name << "," - << " len=" << data->args.hipDeviceGetName.len << "," - << " device=" << data->args.hipDeviceGetName.device - << ")"; - break; case HIP_API_ID_hipEventRecord: oss << "hipEventRecord(" << " event=" << data->args.hipEventRecord.event << "," @@ -1684,6 +1556,12 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " deviceId=" << data->args.hipSetDevice.deviceId << ")"; break; + case HIP_API_ID_hipCtxGetApiVersion: + oss << "hipCtxGetApiVersion(" + << " ctx=" << data->args.hipCtxGetApiVersion.ctx << "," + << " apiVersion=" << data->args.hipCtxGetApiVersion.apiVersion + << ")"; + break; case HIP_API_ID_hipSetupArgument: oss << "hipSetupArgument(" << " arg=" << data->args.hipSetupArgument.arg << "," @@ -1691,16 +1569,6 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " offset=" << data->args.hipSetupArgument.offset << ")"; break; - case HIP_API_ID_hipMemcpyFromSymbolAsync: - oss << "hipMemcpyFromSymbolAsync(" - << " dst=" << data->args.hipMemcpyFromSymbolAsync.dst << "," - << " symbol_name=" << data->args.hipMemcpyFromSymbolAsync.symbol_name << "," - << " sizeBytes=" << data->args.hipMemcpyFromSymbolAsync.sizeBytes << "," - << " offset=" << data->args.hipMemcpyFromSymbolAsync.offset << "," - << " kind=" << data->args.hipMemcpyFromSymbolAsync.kind << "," - << " stream=" << data->args.hipMemcpyFromSymbolAsync.stream - << ")"; - break; case HIP_API_ID_hipMemcpyDtoD: oss << "hipMemcpyDtoD(" << " dst=" << data->args.hipMemcpyDtoD.dst << "," @@ -1708,6 +1576,11 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " sizeBytes=" << data->args.hipMemcpyDtoD.sizeBytes << ")"; break; + case HIP_API_ID_hipHostFree: + oss << "hipHostFree(" + << " ptr=" << data->args.hipHostFree.ptr + << ")"; + break; case HIP_API_ID_hipMemcpy2DToArray: oss << "hipMemcpy2DToArray(" << " dst=" << data->args.hipMemcpy2DToArray.dst << "," @@ -1732,6 +1605,12 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " flags=" << data->args.hipStreamWaitEvent.flags << ")"; break; + case HIP_API_ID_hipDeviceGetStreamPriorityRange: + oss << "hipDeviceGetStreamPriorityRange(" + << " leastPriority=" << data->args.hipDeviceGetStreamPriorityRange.leastPriority << "," + << " greatestPriority=" << data->args.hipDeviceGetStreamPriorityRange.greatestPriority + << ")"; + break; case HIP_API_ID_hipModuleLoad: oss << "hipModuleLoad(" << " module=" << data->args.hipModuleLoad.module << "," @@ -1795,15 +1674,6 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " dptr=" << data->args.hipMemGetAddressRange.dptr << ")"; break; - case HIP_API_ID_hipMemcpyFromSymbol: - oss << "hipMemcpyFromSymbol(" - << " dst=" << data->args.hipMemcpyFromSymbol.dst << "," - << " symbol_name=" << data->args.hipMemcpyFromSymbol.symbol_name << "," - << " sizeBytes=" << data->args.hipMemcpyFromSymbol.sizeBytes << "," - << " offset=" << data->args.hipMemcpyFromSymbol.offset << "," - << " kind=" << data->args.hipMemcpyFromSymbol.kind - << ")"; - break; case HIP_API_ID_hipArrayCreate: oss << "hipArrayCreate(" << " pHandle=" << data->args.hipArrayCreate.pHandle << "," @@ -1872,6 +1742,12 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " count=" << data->args.hipMemcpyAtoH.count << ")"; break; + case HIP_API_ID_hipStreamGetPriority: + oss << "hipStreamGetPriority(" + << " stream=" << data->args.hipStreamGetPriority.stream << "," + << " priority=" << data->args.hipStreamGetPriority.priority + << ")"; + break; case HIP_API_ID_hipMemset2D: oss << "hipMemset2D(" << " dst=" << data->args.hipMemset2D.dst << "," @@ -1928,25 +1804,14 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " stream=" << data->args.hipStreamSynchronize.stream << ")"; break; - case HIP_API_ID_hipFreeHost: - oss << "hipFreeHost(" - << " ptr=" << data->args.hipFreeHost.ptr - << ")"; - break; - case HIP_API_ID_hipRemoveApiCallback: - oss << "hipRemoveApiCallback(" - << " id=" << data->args.hipRemoveApiCallback.id - << ")"; - break; case HIP_API_ID_hipDeviceSetCacheConfig: oss << "hipDeviceSetCacheConfig(" << " cacheConfig=" << data->args.hipDeviceSetCacheConfig.cacheConfig << ")"; break; - case HIP_API_ID_hipCtxGetApiVersion: - oss << "hipCtxGetApiVersion(" - << " ctx=" << data->args.hipCtxGetApiVersion.ctx << "," - << " apiVersion=" << data->args.hipCtxGetApiVersion.apiVersion + case HIP_API_ID_hipGetErrorName: + oss << "hipGetErrorName(" + << " hip_error=" << data->args.hipGetErrorName.hip_error << ")"; break; case HIP_API_ID_hipMemcpyHtoD: @@ -1956,14 +1821,6 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " sizeBytes=" << data->args.hipMemcpyHtoD.sizeBytes << ")"; break; - case HIP_API_ID_hipModuleGetGlobal: - oss << "hipModuleGetGlobal(" - << " dptr=" << data->args.hipModuleGetGlobal.dptr << "," - << " bytes=" << data->args.hipModuleGetGlobal.bytes << "," - << " hmod=" << data->args.hipModuleGetGlobal.hmod << "," - << " name=" << data->args.hipModuleGetGlobal.name - << ")"; - break; case HIP_API_ID_hipMemcpyHtoA: oss << "hipMemcpyHtoA(" << " dstArray=" << data->args.hipMemcpyHtoA.dstArray << "," @@ -2013,13 +1870,6 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " device=" << data->args.hipDeviceComputeCapability.device << ")"; break; - case HIP_API_ID_hipRegisterApiCallback: - oss << "hipRegisterApiCallback(" - << " id=" << data->args.hipRegisterApiCallback.id << "," - << " fun=" << data->args.hipRegisterApiCallback.fun << "," - << " arg=" << data->args.hipRegisterApiCallback.arg - << ")"; - break; case HIP_API_ID_hipDeviceGet: oss << "hipDeviceGet(" << " device=" << data->args.hipDeviceGet.device << "," @@ -2154,18 +2004,28 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " pConfig=" << data->args.hipDeviceGetSharedMemConfig.pConfig << ")"; break; - case HIP_API_ID_hipRegisterActivityCallback: - oss << "hipRegisterActivityCallback(" - << " id=" << data->args.hipRegisterActivityCallback.id << "," - << " fun=" << data->args.hipRegisterActivityCallback.fun << "," - << " arg=" << data->args.hipRegisterActivityCallback.arg - << ")"; - break; case HIP_API_ID_hipSetDeviceFlags: oss << "hipSetDeviceFlags(" << " flags=" << data->args.hipSetDeviceFlags.flags << ")"; break; + case HIP_API_ID_hipHccModuleLaunchKernel: + oss << "hipHccModuleLaunchKernel(" + << " f=" << data->args.hipHccModuleLaunchKernel.f << "," + << " globalWorkSizeX=" << data->args.hipHccModuleLaunchKernel.globalWorkSizeX << "," + << " globalWorkSizeY=" << data->args.hipHccModuleLaunchKernel.globalWorkSizeY << "," + << " globalWorkSizeZ=" << data->args.hipHccModuleLaunchKernel.globalWorkSizeZ << "," + << " localWorkSizeX=" << data->args.hipHccModuleLaunchKernel.localWorkSizeX << "," + << " localWorkSizeY=" << data->args.hipHccModuleLaunchKernel.localWorkSizeY << "," + << " localWorkSizeZ=" << data->args.hipHccModuleLaunchKernel.localWorkSizeZ << "," + << " sharedMemBytes=" << data->args.hipHccModuleLaunchKernel.sharedMemBytes << "," + << " hStream=" << data->args.hipHccModuleLaunchKernel.hStream << "," + << " kernelParams=" << data->args.hipHccModuleLaunchKernel.kernelParams << "," + << " extra=" << data->args.hipHccModuleLaunchKernel.extra << "," + << " startEvent=" << data->args.hipHccModuleLaunchKernel.startEvent << "," + << " stopEvent=" << data->args.hipHccModuleLaunchKernel.stopEvent + << ")"; + break; case HIP_API_ID_hipFree: oss << "hipFree(" << " ptr=" << data->args.hipFree.ptr @@ -2239,10 +2099,9 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " ctx=" << data->args.hipCtxSetCurrent.ctx << ")"; break; - case HIP_API_ID_hipMallocHost: - oss << "hipMallocHost(" - << " ptr=" << data->args.hipMallocHost.ptr << "," - << " size=" << data->args.hipMallocHost.size + case HIP_API_ID_hipGetErrorString: + oss << "hipGetErrorString(" + << " hipError=" << data->args.hipGetErrorString.hipError << ")"; break; case HIP_API_ID_hipDevicePrimaryCtxRetain: @@ -2284,12 +2143,6 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " stream=" << data->args.hipMemcpy2DAsync.stream << ")"; break; - case HIP_API_ID_hipFuncGetAttributes: - oss << "hipFuncGetAttributes(" - << " attr=" << data->args.hipFuncGetAttributes.attr << "," - << " func=" << data->args.hipFuncGetAttributes.func - << ")"; - break; case HIP_API_ID_hipEventCreateWithFlags: oss << "hipEventCreateWithFlags(" << " event=" << data->args.hipEventCreateWithFlags.event << "," @@ -2320,13 +2173,6 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { oss << "hipPeekAtLastError(" << ")"; break; - case HIP_API_ID_hipHostAlloc: - oss << "hipHostAlloc(" - << " ptr=" << data->args.hipHostAlloc.ptr << "," - << " size=" << data->args.hipHostAlloc.size << "," - << " flags=" << data->args.hipHostAlloc.flags - << ")"; - break; case HIP_API_ID_hipStreamAddCallback: oss << "hipStreamAddCallback(" << " stream=" << data->args.hipStreamAddCallback.stream << "," @@ -2345,6 +2191,13 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " kind=" << data->args.hipMemcpyToArray.kind << ")"; break; + case HIP_API_ID_hipMemsetD32: + oss << "hipMemsetD32(" + << " dest=" << data->args.hipMemsetD32.dest << "," + << " value=" << data->args.hipMemsetD32.value << "," + << " count=" << data->args.hipMemsetD32.count + << ")"; + break; case HIP_API_ID_hipDeviceSynchronize: oss << "hipDeviceSynchronize(" << ")"; @@ -2374,13 +2227,11 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " stream=" << data->args.hipMemsetAsync.stream << ")"; break; - case HIP_API_ID_hipMemcpyToSymbol: - oss << "hipMemcpyToSymbol(" - << " symbol_name=" << data->args.hipMemcpyToSymbol.symbol_name << "," - << " src=" << data->args.hipMemcpyToSymbol.src << "," - << " sizeBytes=" << data->args.hipMemcpyToSymbol.sizeBytes << "," - << " offset=" << data->args.hipMemcpyToSymbol.offset << "," - << " kind=" << data->args.hipMemcpyToSymbol.kind + case HIP_API_ID_hipDeviceGetName: + oss << "hipDeviceGetName(" + << " name=" << data->args.hipDeviceGetName.name << "," + << " len=" << data->args.hipDeviceGetName.len << "," + << " device=" << data->args.hipDeviceGetName.device << ")"; break; case HIP_API_ID_hipCtxPushCurrent: @@ -2439,11 +2290,6 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " extra=" << data->args.hipModuleLaunchKernel.extra << ")"; break; - case HIP_API_ID_hipHccModuleLaunchKernel: - oss << "hipHccModuleLaunchKernel(" - << " f=" << data->args.hipHccModuleLaunchKernel.f << "," - << ")"; - break; case HIP_API_ID_hipModuleGetTexRef: oss << "hipModuleGetTexRef(" << " texRef=" << data->args.hipModuleGetTexRef.texRef << "," @@ -2451,11 +2297,6 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " name=" << data->args.hipModuleGetTexRef.name << ")"; break; - case HIP_API_ID_hipRemoveActivityCallback: - oss << "hipRemoveActivityCallback(" - << " id=" << data->args.hipRemoveActivityCallback.id - << ")"; - break; case HIP_API_ID_hipDeviceGetLimit: oss << "hipDeviceGetLimit(" << " pValue=" << data->args.hipDeviceGetLimit.pValue << "," @@ -2504,14 +2345,6 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " pCopy=" << data->args.hipMemcpyParam2D.pCopy << ")"; break; - case HIP_API_ID_hipConfigureCall: - oss << "hipConfigureCall(" - << " gridDim=" << data->args.hipConfigureCall.gridDim << "," - << " blockDim=" << data->args.hipConfigureCall.blockDim << "," - << " sharedMem=" << data->args.hipConfigureCall.sharedMem << "," - << " stream=" << data->args.hipConfigureCall.stream - << ")"; - break; case HIP_API_ID_hipModuleGetFunction: oss << "hipModuleGetFunction(" << " function=" << data->args.hipModuleGetFunction.function << "," @@ -2519,6 +2352,14 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { << " kname=" << data->args.hipModuleGetFunction.kname << ")"; break; + case HIP_API_ID_hipMemsetD32Async: + oss << "hipMemsetD32Async(" + << " dst=" << data->args.hipMemsetD32Async.dst << "," + << " value=" << data->args.hipMemsetD32Async.value << "," + << " count=" << data->args.hipMemsetD32Async.count << "," + << " stream=" << data->args.hipMemsetD32Async.stream + << ")"; + break; case HIP_API_ID_hipGetDevice: oss << "hipGetDevice(" << " deviceId=" << data->args.hipGetDevice.deviceId @@ -2534,5 +2375,4 @@ const char* hipApiString(hip_api_id_t id, const hip_api_data_t* data) { return strdup(oss.str().c_str()); }; #endif - -#endif // _HIP_CBSTR +#endif // _HIP_PROF_STR_H diff --git a/hipamd/include/hip/hcc_detail/hip_runtime_api.h b/hipamd/include/hip/hcc_detail/hip_runtime_api.h index b011911a9d..ea93d28bfe 100644 --- a/hipamd/include/hip/hcc_detail/hip_runtime_api.h +++ b/hipamd/include/hip/hcc_detail/hip_runtime_api.h @@ -2924,7 +2924,7 @@ hipError_t hipRemoveApiCallback(uint32_t id); hipError_t hipRegisterActivityCallback(uint32_t id, void* fun, void* arg); hipError_t hipRemoveActivityCallback(uint32_t id); static inline const char* hipApiName(const uint32_t& id) { return hip_api_name(id); } -const char* hipKernelNameRef(hipFunction_t f); +const char* hipKernelNameRef(const hipFunction_t f); #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/hipamd/src/hip_intercept.cpp b/hipamd/src/hip_intercept.cpp index 459b360f2c..cab8aeb23b 100644 --- a/hipamd/src/hip_intercept.cpp +++ b/hipamd/src/hip_intercept.cpp @@ -27,7 +27,7 @@ THE SOFTWARE. api_callbacks_table_t callbacks_table; -extern std::string& FunctionSymbol(hipFunction_t f); +extern std::string& FunctionSymbol(const hipFunction_t f); const char* hipKernelNameRef(const hipFunction_t f) { return FunctionSymbol(f).c_str(); } hipError_t hipRegisterApiCallback(uint32_t id, void* fun, void* arg) { diff --git a/hipamd/src/hip_module.cpp b/hipamd/src/hip_module.cpp index aec9c58e7f..994f211bb4 100644 --- a/hipamd/src/hip_module.cpp +++ b/hipamd/src/hip_module.cpp @@ -99,7 +99,7 @@ string ToString(hipFunction_t v) { return ss.str(); }; -std::string& FunctionSymbol(hipFunction_t f) { return f->_name; }; +const std::string& FunctionSymbol(const hipFunction_t f) { return f->_name; }; #define CHECK_HSA(hsaStatus, hipStatus) \ if (hsaStatus != HSA_STATUS_SUCCESS) { \ @@ -262,7 +262,7 @@ hipError_t hipExtModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX, uint32_t localWorkSizeZ, size_t sharedMemBytes, hipStream_t hStream, void** kernelParams, void** extra, hipEvent_t startEvent, hipEvent_t stopEvent, uint32_t flags) { - HIP_INIT_API(hipHccModuleLaunchKernel, f, globalWorkSizeX, globalWorkSizeY, globalWorkSizeZ, localWorkSizeX, + HIP_INIT_API(hipExtModuleLaunchKernel, f, globalWorkSizeX, globalWorkSizeY, globalWorkSizeZ, localWorkSizeX, localWorkSizeY, localWorkSizeZ, sharedMemBytes, hStream, kernelParams, extra); return ihipLogStatus(ihipModuleLaunchKernel( f, globalWorkSizeX, globalWorkSizeY, globalWorkSizeZ, localWorkSizeX, localWorkSizeY, diff --git a/hipamd/src/hip_peer.cpp b/hipamd/src/hip_peer.cpp index cffb895c57..32beda2caf 100644 --- a/hipamd/src/hip_peer.cpp +++ b/hipamd/src/hip_peer.cpp @@ -73,7 +73,7 @@ hipError_t ihipDeviceCanAccessPeer(int* canAccessPeer, hipCtx_t thisCtx, hipCtx_ */ //--- hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, hipCtx_t thisCtx, hipCtx_t peerCtx) { - HIP_INIT_API(hipDeviceCanAccessPeer2, canAccessPeer, thisCtx, peerCtx); + HIP_INIT_API(NONE, canAccessPeer, thisCtx, peerCtx); return ihipLogStatus(ihipDeviceCanAccessPeer(canAccessPeer, thisCtx, peerCtx)); } @@ -150,7 +150,7 @@ hipError_t ihipEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags) { //--- hipError_t hipMemcpyPeer(void* dst, hipCtx_t dstCtx, const void* src, hipCtx_t srcCtx, size_t sizeBytes) { - HIP_INIT_API(hipMemcpyPeer2, dst, dstCtx, src, srcCtx, sizeBytes); + HIP_INIT_API(NONE, dst, dstCtx, src, srcCtx, sizeBytes); // TODO - move to ihip memory copy implementaion. // HCC has a unified memory architecture so device specifiers are not required. @@ -161,7 +161,7 @@ hipError_t hipMemcpyPeer(void* dst, hipCtx_t dstCtx, const void* src, hipCtx_t s //--- hipError_t hipMemcpyPeerAsync(void* dst, hipCtx_t dstDevice, const void* src, hipCtx_t srcDevice, size_t sizeBytes, hipStream_t stream) { - HIP_INIT_API(hipMemcpyPeerAsync2, dst, dstDevice, src, srcDevice, sizeBytes, stream); + HIP_INIT_API(NONE, dst, dstDevice, src, srcDevice, sizeBytes, stream); // TODO - move to ihip memory copy implementaion. // HCC has a unified memory architecture so device specifiers are not required.