mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2026-04-02 15:45:41 +08:00
Bug 3570274 and 3570274: Check Unified Memory is supported or not for executing Unified Memory samples
This commit is contained in:
parent
191900a7b4
commit
5cf83b5a98
@ -664,7 +664,17 @@ int main(int argc, char **argv)
|
||||
verboseResults = 1;
|
||||
}
|
||||
|
||||
// set device
|
||||
cudaDeviceProp device_prop;
|
||||
int device_id = findCudaDevice(argc, (const char **)argv);
|
||||
checkCudaErrors(cudaGetDeviceProperties(&device_prop, device_id));
|
||||
|
||||
if (!device_prop.managedMemory) {
|
||||
// This samples requires being run on a device that supports Unified Memory
|
||||
fprintf(stderr, "Unified Memory not supported on this device\n");
|
||||
|
||||
exit(EXIT_WAIVED);
|
||||
}
|
||||
|
||||
matrixMultiplyPerfRunner(reportAsBandwidth, print_launch_transfer_results, print_std_deviation, device_id);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user