mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-06-29 19:28:33 +00:00
24 lines
666 B
C++
24 lines
666 B
C++
#include <hip/hip_runtime.h>
|
|
#include <iostream>
|
|
|
|
int main() {
|
|
int deviceCount = 0;
|
|
hipError_t error = hipGetDeviceCount(&deviceCount);
|
|
|
|
if (error != hipSuccess) {
|
|
std::cout << "HIP Error: " << hipGetErrorString(error) << std::endl;
|
|
return 1;
|
|
}
|
|
|
|
std::cout << "Number of HIP devices: " << deviceCount << std::endl;
|
|
|
|
for (int i = 0; i < deviceCount; i++) {
|
|
hipDeviceProp_t prop;
|
|
hipGetDeviceProperties(&prop, i);
|
|
std::cout << "Device " << i << ": " << prop.name
|
|
<< " (Compute Capability: " << prop.major << "." << prop.minor << ")" << std::endl;
|
|
}
|
|
|
|
return 0;
|
|
}
|