Initial support for hipChooseDevice function

Change-Id: Iedbf5f98c96673ab701dd7539d80a77b994d296f


[ROCm/hip commit: 9e05375acf]
This commit is contained in:
Rahul Garg
2016-09-08 22:37:24 +05:30
parent 1116aa6afa
commit 7e78ed7190
3 changed files with 62 additions and 0 deletions
@@ -0,0 +1,17 @@
#include <stdio.h>
#include <hip_runtime.h>
int main( void ) {
hipDeviceProp_t prop;
int dev;
hipGetDevice( &dev ) ;
printf( "ID of current HIP device: %d\n", dev );
memset( &prop, 0, sizeof( hipDeviceProp_t ) );
prop.major = 1;
prop.minor = 3;
hipChooseDevice( &dev, &prop );
printf( "ID of hip device closest to revision 1.3: %d\n", dev );
hipSetDevice( dev );
}