SWDEV-444021 - Implement hipGetFuncBySymbol

Change-Id: I7ef13d02c5b5c6ce2386ccb92b5602d005b35988
Цей коміт міститься в:
Satyanvesh Dittakavi
2024-02-15 09:42:48 +00:00
джерело 43e2bb6126
коміт 684fd60c8f
7 змінених файлів з 61 додано та 8 видалено
+5 -2
Переглянути файл
@@ -1,5 +1,5 @@
/*
Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
Copyright (c) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -61,7 +61,7 @@
// - Reset any of the *_STEP_VERSION defines to zero if the corresponding *_MAJOR_VERSION increases
#define HIP_API_TABLE_STEP_VERSION 0
#define HIP_COMPILER_API_TABLE_STEP_VERSION 0
#define HIP_RUNTIME_API_TABLE_STEP_VERSION 2
#define HIP_RUNTIME_API_TABLE_STEP_VERSION 3
// HIP API interface
typedef hipError_t (*t___hipPopCallConfiguration)(dim3* gridDim, dim3* blockDim, size_t* sharedMem,
@@ -952,6 +952,8 @@ typedef hipError_t (*t_hipStreamBeginCaptureToGraph)(hipStream_t stream, hipGrap
const hipGraphEdgeData* dependencyData,
size_t numDependencies,
hipStreamCaptureMode mode);
typedef hipError_t (*t_hipGetFuncBySymbol)(hipFunction_t* functionPtr, const void* symbolPtr);
// HIP Compiler dispatch table
struct HipCompilerDispatchTable {
size_t size;
@@ -1417,4 +1419,5 @@ struct HipDispatchTable {
t_hipTexRefGetArray hipTexRefGetArray_fn;
t_hipGetProcAddress hipGetProcAddress_fn;
t_hipStreamBeginCaptureToGraph hipStreamBeginCaptureToGraph_fn;
t_hipGetFuncBySymbol hipGetFuncBySymbol_fn;
};
+25 -1
Переглянути файл
@@ -409,7 +409,8 @@ enum hip_api_id_t {
HIP_API_ID_hipTexRefGetArray = 389,
HIP_API_ID_hipTexRefGetBorderColor = 390,
HIP_API_ID_hipStreamBeginCaptureToGraph = 391,
HIP_API_ID_LAST = 391,
HIP_API_ID_hipGetFuncBySymbol = 392,
HIP_API_ID_LAST = 392,
HIP_API_ID_hipChooseDevice = HIP_API_ID_CONCAT(HIP_API_ID_,hipChooseDevice),
HIP_API_ID_hipGetDeviceProperties = HIP_API_ID_CONCAT(HIP_API_ID_,hipGetDeviceProperties),
@@ -563,6 +564,7 @@ static inline const char* hip_api_name(const uint32_t id) {
case HIP_API_ID_hipGetDevicePropertiesR0000: return "hipGetDevicePropertiesR0000";
case HIP_API_ID_hipGetDevicePropertiesR0600: return "hipGetDevicePropertiesR0600";
case HIP_API_ID_hipGetErrorString: return "hipGetErrorString";
case HIP_API_ID_hipGetFuncBySymbol: return "hipGetFuncBySymbol";
case HIP_API_ID_hipGetLastError: return "hipGetLastError";
case HIP_API_ID_hipGetMipmappedArrayLevel: return "hipGetMipmappedArrayLevel";
case HIP_API_ID_hipGetProcAddress: return "hipGetProcAddress";
@@ -957,6 +959,7 @@ static inline uint32_t hipApiIdByName(const char* name) {
if (strcmp("hipGetDevicePropertiesR0000", name) == 0) return HIP_API_ID_hipGetDevicePropertiesR0000;
if (strcmp("hipGetDevicePropertiesR0600", name) == 0) return HIP_API_ID_hipGetDevicePropertiesR0600;
if (strcmp("hipGetErrorString", name) == 0) return HIP_API_ID_hipGetErrorString;
if (strcmp("hipGetFuncBySymbol", name) == 0) return HIP_API_ID_hipGetFuncBySymbol;
if (strcmp("hipGetLastError", name) == 0) return HIP_API_ID_hipGetLastError;
if (strcmp("hipGetMipmappedArrayLevel", name) == 0) return HIP_API_ID_hipGetMipmappedArrayLevel;
if (strcmp("hipGetProcAddress", name) == 0) return HIP_API_ID_hipGetProcAddress;
@@ -1786,6 +1789,11 @@ typedef struct hip_api_data_s {
hipDeviceProp_tR0600 prop__val;
int deviceId;
} hipGetDevicePropertiesR0600;
struct {
hipFunction_t* functionPtr;
hipFunction_t functionPtr__val;
const void* symbolPtr;
} hipGetFuncBySymbol;
struct {
hipArray_t* levelArray;
hipArray_t levelArray__val;
@@ -4093,6 +4101,11 @@ typedef struct hip_api_data_s {
// hipGetErrorString[]
#define INIT_hipGetErrorString_CB_ARGS_DATA(cb_data) { \
};
// hipGetFuncBySymbol[('hipFunction_t*', 'functionPtr'), ('const void*', 'symbolPtr')]
#define INIT_hipGetFuncBySymbol_CB_ARGS_DATA(cb_data) { \
cb_data.args.hipGetFuncBySymbol.functionPtr = (hipFunction_t*)functionPtr; \
cb_data.args.hipGetFuncBySymbol.symbolPtr = (const void*)symbolPtr; \
};
// hipGetLastError[]
#define INIT_hipGetLastError_CB_ARGS_DATA(cb_data) { \
};
@@ -6344,6 +6357,10 @@ static inline void hipApiArgsInit(hip_api_id_t id, hip_api_data_t* data) {
// hipGetErrorString[]
case HIP_API_ID_hipGetErrorString:
break;
// hipGetFuncBySymbol[('hipFunction_t*', 'functionPtr'), ('const void*', 'symbolPtr')]
case HIP_API_ID_hipGetFuncBySymbol:
if (data->args.hipGetFuncBySymbol.functionPtr) data->args.hipGetFuncBySymbol.functionPtr__val = *(data->args.hipGetFuncBySymbol.functionPtr);
break;
// hipGetLastError[]
case HIP_API_ID_hipGetLastError:
break;
@@ -8225,6 +8242,13 @@ static inline const char* hipApiString(hip_api_id_t id, const hip_api_data_t* da
oss << "hipGetErrorString(";
oss << ")";
break;
case HIP_API_ID_hipGetFuncBySymbol:
oss << "hipGetFuncBySymbol(";
if (data->args.hipGetFuncBySymbol.functionPtr == NULL) oss << "functionPtr=NULL";
else { oss << "functionPtr="; roctracer::hip_support::detail::operator<<(oss, data->args.hipGetFuncBySymbol.functionPtr__val); }
oss << ", symbolPtr="; roctracer::hip_support::detail::operator<<(oss, data->args.hipGetFuncBySymbol.symbolPtr);
oss << ")";
break;
case HIP_API_ID_hipGetLastError:
oss << "hipGetLastError(";
oss << ")";