diff --git a/projects/hip/tests/src/Functional/Negative/Device/hipDeviceUtil.h b/projects/hip/tests/src/Functional/Negative/Device/hipDeviceUtil.h new file mode 100644 index 0000000000..392aa8c277 --- /dev/null +++ b/projects/hip/tests/src/Functional/Negative/Device/hipDeviceUtil.h @@ -0,0 +1,10 @@ +#ifndef HIPDEVICEUTIL_H +#define HIPDEVICEUTIL_H + +#include +#include + +#define HIP_CHECK(status, func) \ + std::cout<<#func<<" returned "< +#include +#include"hipDeviceUtil.h" + +int main() +{ + int device; + HIP_CHECK(hipGetDevice(NULL), hipGetDevice); + HIP_CHECK(hipGetDevice(&device), hipGetDevice); +} diff --git a/projects/hip/tests/src/Functional/Negative/Device/hipSetDevice.cpp b/projects/hip/tests/src/Functional/Negative/Device/hipSetDevice.cpp new file mode 100644 index 0000000000..4269627ad5 --- /dev/null +++ b/projects/hip/tests/src/Functional/Negative/Device/hipSetDevice.cpp @@ -0,0 +1,10 @@ +#include +#include +#include"hipDeviceUtil.h" + +int main() +{ + HIP_CHECK(hipSetDevice(0), hipSetDevice); + HIP_CHECK(hipSetDevice(1026), hipSetDevice); + HIP_CHECK(hipSetDevice(-1), hipSetDevice); +}