EXSWCPHIPT-13 - Fix Segfault on Nvidia Platform

Change-Id: Ib85bb0b0e91b7703afc4858c4a5ada0115ad68f4
Tento commit je obsažen v:
Satyanvesh Dittakavi
2022-02-02 15:51:09 +00:00
rodič 0e94178c03
revize f3f11f4c7d
+10
Zobrazit soubor
@@ -1220,6 +1220,11 @@ inline static hipError_t hipSetDevice(int device) {
}
inline static hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop) {
if (prop == NULL) {
return hipErrorInvalidValue;
}
struct cudaDeviceProp cdprop;
memset(&cdprop, 0x0, sizeof(struct cudaDeviceProp));
cdprop.major = prop->major;
@@ -1532,6 +1537,11 @@ inline static hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int valu
}
inline static hipError_t hipGetDeviceProperties(hipDeviceProp_t* p_prop, int device) {
if (p_prop == NULL) {
return hipErrorInvalidValue;
}
struct cudaDeviceProp cdprop;
cudaError_t cerror;
cerror = cudaGetDeviceProperties(&cdprop, device);