changed __global__ attribute

1. Moved around tests and added them to HIT

Change-Id: I5d75280c42a5af852670ebabc7305ee56721ec7b


[ROCm/hip commit: 5e3d63c0a3]
This commit is contained in:
Aditya Atluri
2017-02-03 10:53:36 -06:00
parent afb38e15de
commit 6d5992d445
52 changed files with 316 additions and 411 deletions
@@ -0,0 +1,21 @@
#include "hip/hip_runtime.h"
#include "hip/hip_runtime_api.h"
#include"hipDeviceUtil.h"
int main()
{
int pi;
int attr = 0;
// hipDeviceAttribute_t attr = hipDeviceAttributeMaxThreadsPerBlock;
HIP_CHECK(hipDeviceGetAttribute(NULL, hipDeviceAttribute_t(attr), 0), hipDeviceGetAttribute);
HIP_CHECK(hipDeviceGetAttribute(&pi, hipDeviceAttribute_t(attr), 0), hipDeviceGetAttribute);
attr = -1;
HIP_CHECK(hipDeviceGetAttribute(NULL, hipDeviceAttribute_t(attr), 0), hipDeviceGetAttribute);
HIP_CHECK(hipDeviceGetAttribute(&pi, hipDeviceAttribute_t(attr), 0), hipDeviceGetAttribute);
attr = 0;
HIP_CHECK(hipDeviceGetAttribute(NULL, hipDeviceAttribute_t(attr), -1), hipDeviceGetAttribute);
HIP_CHECK(hipDeviceGetAttribute(&pi, hipDeviceAttribute_t(attr), -1), hipDeviceGetAttribute);
attr = -1;
HIP_CHECK(hipDeviceGetAttribute(NULL, hipDeviceAttribute_t(attr), -1), hipDeviceGetAttribute);
HIP_CHECK(hipDeviceGetAttribute(&pi, hipDeviceAttribute_t(attr), -1), hipDeviceGetAttribute);
}
@@ -0,0 +1,10 @@
#ifndef HIPDEVICEUTIL_H
#define HIPDEVICEUTIL_H
#include "hip/hip_runtime_api.h"
#include<iostream>
#define HIP_CHECK(status, func) \
std::cout<<#func<<" returned "<<hipGetErrorString(status)<<" in "<<__func__<<" at "<<__LINE__<<" in file "<<__FILE__<<std::endl;
#endif
@@ -0,0 +1,10 @@
#include "hip/hip_runtime.h"
#include "hip/hip_runtime_api.h"
#include"hipDeviceUtil.h"
int main()
{
int device;
HIP_CHECK(hipGetDevice(NULL), hipGetDevice);
HIP_CHECK(hipGetDevice(&device), hipGetDevice);
}
@@ -0,0 +1,10 @@
#include "hip/hip_runtime.h"
#include "hip/hip_runtime_api.h"
#include"hipDeviceUtil.h"
int main()
{
int deviceCnt;
HIP_CHECK(hipGetDeviceCount(&deviceCnt), hipGetDeviceCount);
HIP_CHECK(hipGetDeviceCount(0), hipGetDeviceCount);
}
@@ -0,0 +1,14 @@
#include "hip/hip_runtime.h"
#include "hip/hip_runtime_api.h"
#include"hipDeviceUtil.h"
int main()
{
hipDeviceProp_t props;
HIP_CHECK(hipGetDeviceProperties(&props, 0), hipGetDeviceProperties);
HIP_CHECK(hipGetDeviceProperties(NULL, 0), hipGetDeviceProperties);
HIP_CHECK(hipGetDeviceProperties(NULL, -1), hipGetDeviceProperties);
HIP_CHECK(hipGetDeviceProperties(&props, -1), hipGetDeviceProperties);
HIP_CHECK(hipGetDeviceProperties(NULL, 1024), hipGetDeviceProperties);
HIP_CHECK(hipGetDeviceProperties(&props, 1024), hipGetDeviceProperties);
}
@@ -0,0 +1,10 @@
#include "hip/hip_runtime.h"
#include "hip/hip_runtime_api.h"
#include"hipDeviceUtil.h"
int main()
{
HIP_CHECK(hipSetDevice(0), hipSetDevice);
HIP_CHECK(hipSetDevice(1026), hipSetDevice);
HIP_CHECK(hipSetDevice(-1), hipSetDevice);
}