added tests to check nvcc runtime api output

Change-Id: Ifdd39b5d0a6a58d20a8e9745e59dd82d50a90e2f
This commit is contained in:
Aditya Atluri
2016-11-19 21:36:28 -06:00
parent 53e771fc75
commit 428041cfc2
11 changed files with 87 additions and 2 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ THE SOFTWARE.
#include <limits.h>
#include <hip/hip_runtime.h>
#include <hip/hcc_detail/hip_runtime.h>
//----
//Texture - TODO - likely need to move this to a separate file only included with kernel compilation.
+13
View File
@@ -0,0 +1,13 @@
#ifndef HIP_TEXTURE_H
#define HIP_TEXTURE_H
#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__)
#include <hip/hcc_detail/hip_texture.h>
#elif defined(__HIP_PLATFORM_NVCC__) && !defined (__HIP_PLATFORM_HCC__)
#include <hip/nvcc_detail/hip_texture.h>
#else
#error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__");
#endif
#endif
+6
View File
@@ -0,0 +1,6 @@
#ifndef HIP_TEXTURE_H
#define HIP_TEXTURE_H
#include <cuda_texture.h>
#endif
+11
View File
@@ -0,0 +1,11 @@
#include<hip/hip_runtime_api.h>
#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));
}
@@ -0,0 +1,8 @@
#include <hip/hip_runtime_api.h>
#include "test_common.h"
int main()
{
hipLimit_t lim = hipLimitMallocHeapSize;
HIP_PRINT_STATUS(hipDeviceGetLimit(NULL, lim));
}
+8
View File
@@ -0,0 +1,8 @@
#include <hip/hip_runtime_api.h>
#include "test_common.h"
int main()
{
HIP_PRINT_STATUS(hipGetDevice(NULL));
HIP_PRINT_STATUS(hipGetDevice(0));
}
@@ -0,0 +1,7 @@
#include <hip/hip_runtime_api.h>
#include "test_common.h"
int main()
{
HIP_PRINT_STATUS(hipGetDeviceCount(NULL));
}
@@ -0,0 +1,12 @@
#include <hip/hip_runtime_api.h>
#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));
}
+10
View File
@@ -0,0 +1,10 @@
#include <hip/hip_runtime_api.h>
#include "test_common.h"
int main()
{
HIP_PRINT_STATUS(hipSetDevice(-1));
int count;
hipGetDeviceCount(&count);
HIP_PRINT_STATUS(hipSetDevice(count+1));
}
@@ -0,0 +1,8 @@
#include <hip/hip_runtime_api.h>
#include "test_common.h"
int main()
{
HIP_PRINT_STATUS(hipSetDeviceFlags(-1));
HIP_PRINT_STATUS(hipSetDeviceFlags(11));
}
+3 -1
View File
@@ -23,7 +23,7 @@ THE SOFTWARE.
#include <stddef.h>
#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<<hipGetErrorName(status)<<std::endl;
#define HIPCHECK(error) \
{\