add can_map_host_memory.cpp and gcn_arch_name.cpp

This commit is contained in:
Carl Pearson
2025-01-08 08:22:09 -08:00
parent cf83db731c
commit 99f9b302e3
4 changed files with 52 additions and 0 deletions

24
can_map_host_memory.cpp Normal file
View File

@@ -0,0 +1,24 @@
#include <iostream>
#include <hip/hip_runtime.h>
#define HIP(e) \
if (hipError_t err = (e); err != hipSuccess) { \
std::cerr << __FILE__ << ":" << __LINE__ << " " << err << "\n"; \
exit(1); \
}
int main(void) {
hipDeviceProp_t props;
HIP(hipGetDeviceProperties(&props, 0));
std::cout << "canMapHostMemory: " << props.canMapHostMemory << "\n";
if (props.canMapHostMemory) {
return 0;
} else {
return 1;
}
}