Introducing hip::Device which wraps around amd::Context and deviceId
Change-Id: Ie35a6edb65c001b35eb9f5d2af26e765dc41c00e
이 커밋은 다음에 포함됨:
1 부모
e066cc6f60
커밋
b4ad4262cc
9 파일이 변경됨
+145
-120
검색과 일치하는 파일 없음
@@ -430,12 +430,7 @@ hipError_t hipDeviceSynchronize ( void ) {
|
||||
}
|
||||
|
||||
int ihipGetDevice() {
|
||||
for (unsigned int i = 0; i < g_devices.size(); i++) {
|
||||
if (g_devices[i] == hip::getCurrentContext()) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return hip::getCurrentDevice()->deviceId();
|
||||
}
|
||||
|
||||
hipError_t hipGetDevice ( int* deviceId ) {
|
||||
@@ -483,7 +478,7 @@ hipError_t hipSetDevice ( int device ) {
|
||||
HIP_INIT_API(hipSetDevice, device);
|
||||
|
||||
if (static_cast<unsigned int>(device) < g_devices.size()) {
|
||||
hip::setCurrentContext(device);
|
||||
hip::setCurrentDevice(device);
|
||||
|
||||
HIP_RETURN(hipSuccess);
|
||||
}
|
||||
|
||||
새 이슈에서 참조
사용자 차단