adding hipGetStreamDeviceId() profiling API

Change-Id: I5ccf88ddac123260d7c17defefcf20ff3b2504e2
이 커밋은 다음에 포함됨:
Evgeny 작성하고 Evgeny Shcherbakov가 2020-06-03 18:57:49 -04:00를 커밋함
1 부모 56392b4f8a
커밋 cad3f805c0
3 파일이 변경됨
+13 -2

검색과 일치하는 파일 없음

+1
파일 보기
@@ -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
+1
파일 보기
@@ -183,6 +183,7 @@ global:
hipApiName;
hipKernelNameRef;
hipKernelNameRefByPtr;
hipGetStreamDeviceId;
hipProfilerStart;
hipProfilerStop;
hiprtcCompileProgram;
+11 -2
파일 보기
@@ -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;