5947878247
Change-Id: Iab1aee638b7158eb9674a19625dedf6471947e51
18 lines
432 B
C++
18 lines
432 B
C++
#include <stdio.h>
|
|
#include "hip/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 );
|
|
}
|