Initial support for hipChooseDevice function

Change-Id: Iedbf5f98c96673ab701dd7539d80a77b994d296f
Cette révision appartient à :
Rahul Garg
2016-09-08 22:37:24 +05:30
Parent 6db6dbaaaf
révision 9e05375acf
3 fichiers modifiés avec 62 ajouts et 0 suppressions
+17
Voir le fichier
@@ -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 );
}