added negative testing for device APIs
Change-Id: I7bfcdd777f240d36b29eca987f7bc9da7614d704
[ROCm/hip commit: 4d56ac99e4]
Ta zmiana jest zawarta w:
%! (template.HTML=
Aditya Atluri)złożyło 2016-09-27 11:38:31 -05:00
1 rodzic
a826689145
złożenie
e8eff449ec
3 plików zmienionych
+30
Żadne pliki nie pasują do Twojego wyszukiwania
@@ -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()
|
||||
{
|
||||
HIP_CHECK(hipSetDevice(0), hipSetDevice);
|
||||
HIP_CHECK(hipSetDevice(1026), hipSetDevice);
|
||||
HIP_CHECK(hipSetDevice(-1), hipSetDevice);
|
||||
}
|
||||
Reference in new issue
Zablokuj użytkownika