adding hipGetStreamDeviceId() profiling API

Change-Id: I5ccf88ddac123260d7c17defefcf20ff3b2504e2


[ROCm/hip commit: cad3f805c0]
Tento commit je obsažen v:
Evgeny
2020-06-03 01:30:44 -05:00
odevzdal Evgeny Shcherbakov
rodič 9dabdf86fe
revize 037da0c744
3 změnil soubory, kde provedl 13 přidání a 2 odebrání
+11 -2
Zobrazit soubor
@@ -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;