diff --git a/include/hip/hcc_detail/hip_texture.h b/include/hip/hcc_detail/hip_texture.h index c83917b8d6..7bd14c7a40 100644 --- a/include/hip/hcc_detail/hip_texture.h +++ b/include/hip/hcc_detail/hip_texture.h @@ -32,7 +32,7 @@ THE SOFTWARE. #include -#include +#include //---- //Texture - TODO - likely need to move this to a separate file only included with kernel compilation. diff --git a/include/hip/hip_texture.h b/include/hip/hip_texture.h new file mode 100644 index 0000000000..b3d830a0df --- /dev/null +++ b/include/hip/hip_texture.h @@ -0,0 +1,13 @@ +#ifndef HIP_TEXTURE_H +#define HIP_TEXTURE_H + +#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__) +#include +#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__) +#include +#else +#error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); +#endif + + +#endif diff --git a/include/hip/nvcc_detail/hip_texture.h b/include/hip/nvcc_detail/hip_texture.h new file mode 100644 index 0000000000..cdd939bc1b --- /dev/null +++ b/include/hip/nvcc_detail/hip_texture.h @@ -0,0 +1,6 @@ +#ifndef HIP_TEXTURE_H +#define HIP_TEXTURE_H + +#include + +#endif diff --git a/tests/src/nvcc/Device/hipChooseDevice.cpp b/tests/src/nvcc/Device/hipChooseDevice.cpp new file mode 100644 index 0000000000..d2fbfe1852 --- /dev/null +++ b/tests/src/nvcc/Device/hipChooseDevice.cpp @@ -0,0 +1,11 @@ +#include +#include"test_common.h" + +int main() +{ + int dev; + hipDeviceProp_t prop; + HIP_PRINT_STATUS(hipChooseDevice(&dev, &prop)); + HIP_PRINT_STATUS(hipChooseDevice(0, &prop)); + HIP_PRINT_STATUS(hipChooseDevice(0, 0)); +} diff --git a/tests/src/nvcc/Device/hipDeviceGetLimit.cpp b/tests/src/nvcc/Device/hipDeviceGetLimit.cpp new file mode 100644 index 0000000000..b17d5d6a07 --- /dev/null +++ b/tests/src/nvcc/Device/hipDeviceGetLimit.cpp @@ -0,0 +1,8 @@ +#include +#include "test_common.h" + +int main() +{ + hipLimit_t lim = hipLimitMallocHeapSize; + HIP_PRINT_STATUS(hipDeviceGetLimit(NULL, lim)); +} diff --git a/tests/src/nvcc/Device/hipGetDevice.cpp b/tests/src/nvcc/Device/hipGetDevice.cpp new file mode 100644 index 0000000000..a009e337a6 --- /dev/null +++ b/tests/src/nvcc/Device/hipGetDevice.cpp @@ -0,0 +1,8 @@ +#include +#include "test_common.h" + +int main() +{ + HIP_PRINT_STATUS(hipGetDevice(NULL)); + HIP_PRINT_STATUS(hipGetDevice(0)); +} diff --git a/tests/src/nvcc/Device/hipGetDeviceCount.cpp b/tests/src/nvcc/Device/hipGetDeviceCount.cpp new file mode 100644 index 0000000000..ec02e57ae3 --- /dev/null +++ b/tests/src/nvcc/Device/hipGetDeviceCount.cpp @@ -0,0 +1,7 @@ +#include +#include "test_common.h" + +int main() +{ + HIP_PRINT_STATUS(hipGetDeviceCount(NULL)); +} diff --git a/tests/src/nvcc/Device/hipGetDeviceProperties.cpp b/tests/src/nvcc/Device/hipGetDeviceProperties.cpp new file mode 100644 index 0000000000..944c4c1516 --- /dev/null +++ b/tests/src/nvcc/Device/hipGetDeviceProperties.cpp @@ -0,0 +1,12 @@ +#include +#include "test_common.h" + +int main() +{ + hipDeviceProp_t prop; + HIP_PRINT_STATUS(hipGetDeviceProperties(&prop, -1)); + int cnt; + hipGetDeviceCount(&cnt); + HIP_PRINT_STATUS(hipGetDeviceProperties(&prop, cnt+1)); + HIP_PRINT_STATUS(hipGetDeviceProperties(NULL, 0)); +} diff --git a/tests/src/nvcc/Device/hipSetDevice.cpp b/tests/src/nvcc/Device/hipSetDevice.cpp new file mode 100644 index 0000000000..7a473ef042 --- /dev/null +++ b/tests/src/nvcc/Device/hipSetDevice.cpp @@ -0,0 +1,10 @@ +#include +#include "test_common.h" + +int main() +{ + HIP_PRINT_STATUS(hipSetDevice(-1)); + int count; + hipGetDeviceCount(&count); + HIP_PRINT_STATUS(hipSetDevice(count+1)); +} diff --git a/tests/src/nvcc/Device/hipSetDeviceFlags.cpp b/tests/src/nvcc/Device/hipSetDeviceFlags.cpp new file mode 100644 index 0000000000..398041b84a --- /dev/null +++ b/tests/src/nvcc/Device/hipSetDeviceFlags.cpp @@ -0,0 +1,8 @@ +#include +#include "test_common.h" + +int main() +{ + HIP_PRINT_STATUS(hipSetDeviceFlags(-1)); + HIP_PRINT_STATUS(hipSetDeviceFlags(11)); +} diff --git a/tests/src/test_common.h b/tests/src/test_common.h index 1c4a6c7c23..ee207db39d 100644 --- a/tests/src/test_common.h +++ b/tests/src/test_common.h @@ -23,7 +23,7 @@ THE SOFTWARE. #include #include "hip/hip_runtime.h" -#include "hip/hcc_detail/hip_texture.h" +#include "hip/hip_texture.h" #define HC __attribute__((hc)) @@ -64,6 +64,8 @@ THE SOFTWARE. printf ("\n");\ printf ("warn: TEST WARNING\n%s", KNRM );\ +#define HIP_PRINT_STATUS(status) \ + std::cout<