adding hipGetStreamDeviceId() profiling API
Change-Id: I5ccf88ddac123260d7c17defefcf20ff3b2504e2
[ROCm/clr commit: 0c0a8fc108]
Esse commit está contido em:
@@ -3662,6 +3662,7 @@ hipError_t hipRemoveActivityCallback(uint32_t id);
|
||||
const char* hipApiName(uint32_t id);
|
||||
const char* hipKernelNameRef(const hipFunction_t f);
|
||||
const char* hipKernelNameRefByPtr(const void* hostFunction, hipStream_t stream);
|
||||
int hipGetStreamDeviceId(hipStream_t stream);
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
@@ -183,6 +183,7 @@ global:
|
||||
hipApiName;
|
||||
hipKernelNameRef;
|
||||
hipKernelNameRefByPtr;
|
||||
hipGetStreamDeviceId;
|
||||
hipProfilerStart;
|
||||
hipProfilerStop;
|
||||
hiprtcCompileProgram;
|
||||
|
||||
@@ -27,10 +27,19 @@
|
||||
api_callbacks_table_t callbacks_table;
|
||||
|
||||
extern const std::string& FunctionName(const hipFunction_t f);
|
||||
|
||||
const char* hipKernelNameRef(const hipFunction_t f) { return FunctionName(f).c_str(); }
|
||||
const char* hipKernelNameRefByPtr(const void *hostFunction, hipStream_t stream) {
|
||||
|
||||
int hipGetStreamDeviceId(hipStream_t stream) {
|
||||
hip::Stream* s = reinterpret_cast<hip::Stream*>(stream);
|
||||
int deviceId = (s != nullptr)? s->DeviceId() : ihipGetDevice();
|
||||
return (s != nullptr)? s->DeviceId() : ihipGetDevice();
|
||||
}
|
||||
|
||||
const char* hipKernelNameRefByPtr(const void* hostFunction, hipStream_t stream) {
|
||||
if (hostFunction == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
int deviceId = hipGetStreamDeviceId(stream);
|
||||
if (deviceId == -1) {
|
||||
DevLogPrintfError("Wrong Device Id: %d \n", deviceId);
|
||||
return NULL;
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário