Initial support for hipChooseDevice function
Change-Id: Iedbf5f98c96673ab701dd7539d80a77b994d296f
[ROCm/hip commit: 9e05375acf]
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
Reference in New Issue
Block a user