
Co-authored-by: Philipp Moritz <pcmoritz@gmail.com> Co-authored-by: Amir Balwel <amoooori04@gmail.com> Co-authored-by: root <kuanfu.liu@akirakan.com> Co-authored-by: tjtanaa <tunjian.tan@embeddedllm.com> Co-authored-by: kuanfu <kuanfu.liu@embeddedllm.com> Co-authored-by: miloice <17350011+kliuae@users.noreply.github.com>
18 lines
355 B
Plaintext
18 lines
355 B
Plaintext
#ifdef USE_ROCM
|
|
#include <hip/hip_runtime.h>
|
|
#endif
|
|
int get_device_attribute(
|
|
int attribute,
|
|
int device_id)
|
|
{
|
|
int device, value;
|
|
if (device_id < 0) {
|
|
cudaGetDevice(&device);
|
|
}
|
|
else {
|
|
device = device_id;
|
|
}
|
|
cudaDeviceGetAttribute(&value, static_cast<cudaDeviceAttr>(attribute), device);
|
|
return value;
|
|
}
|