mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
Warning squash
This commit is contained in:
parent
d0b6593823
commit
9f40467e24
@ -120,7 +120,7 @@ hipStream_t computeStream;
|
|||||||
void acceleratorInit(void)
|
void acceleratorInit(void)
|
||||||
{
|
{
|
||||||
int nDevices = 1;
|
int nDevices = 1;
|
||||||
hipGetDeviceCount(&nDevices);
|
auto discard = hipGetDeviceCount(&nDevices);
|
||||||
gpu_props = new hipDeviceProp_t[nDevices];
|
gpu_props = new hipDeviceProp_t[nDevices];
|
||||||
|
|
||||||
char * localRankStr = NULL;
|
char * localRankStr = NULL;
|
||||||
@ -147,7 +147,7 @@ void acceleratorInit(void)
|
|||||||
#define GPU_PROP_FMT(canMapHostMemory,FMT) printf("AcceleratorHipInit: " #canMapHostMemory ": " FMT" \n",prop.canMapHostMemory);
|
#define GPU_PROP_FMT(canMapHostMemory,FMT) printf("AcceleratorHipInit: " #canMapHostMemory ": " FMT" \n",prop.canMapHostMemory);
|
||||||
#define GPU_PROP(canMapHostMemory) GPU_PROP_FMT(canMapHostMemory,"%d");
|
#define GPU_PROP(canMapHostMemory) GPU_PROP_FMT(canMapHostMemory,"%d");
|
||||||
|
|
||||||
hipGetDeviceProperties(&gpu_props[i], i);
|
discard = hipGetDeviceProperties(&gpu_props[i], i);
|
||||||
hipDeviceProp_t prop;
|
hipDeviceProp_t prop;
|
||||||
prop = gpu_props[i];
|
prop = gpu_props[i];
|
||||||
totalDeviceMem = prop.totalGlobalMem;
|
totalDeviceMem = prop.totalGlobalMem;
|
||||||
@ -184,13 +184,13 @@ void acceleratorInit(void)
|
|||||||
}
|
}
|
||||||
int device = rank;
|
int device = rank;
|
||||||
#endif
|
#endif
|
||||||
hipSetDevice(device);
|
discard = hipSetDevice(device);
|
||||||
hipStreamCreate(©Stream);
|
discard = hipStreamCreate(©Stream);
|
||||||
hipStreamCreate(&computeStream);
|
discard = hipStreamCreate(&computeStream);
|
||||||
const int len=64;
|
const int len=64;
|
||||||
char busid[len];
|
char busid[len];
|
||||||
if( rank == world_rank ) {
|
if( rank == world_rank ) {
|
||||||
hipDeviceGetPCIBusId(busid, len, device);
|
discard = hipDeviceGetPCIBusId(busid, len, device);
|
||||||
printf("local rank %d device %d bus id: %s\n", rank, device, busid);
|
printf("local rank %d device %d bus id: %s\n", rank, device, busid);
|
||||||
}
|
}
|
||||||
if ( world_rank == 0 ) printf("AcceleratorHipInit: ================================================\n");
|
if ( world_rank == 0 ) printf("AcceleratorHipInit: ================================================\n");
|
||||||
|
@ -397,7 +397,7 @@ NAMESPACE_BEGIN(Grid);
|
|||||||
inline void acceleratorMem(void)
|
inline void acceleratorMem(void)
|
||||||
{
|
{
|
||||||
size_t free_t,total_t,used_t;
|
size_t free_t,total_t,used_t;
|
||||||
hipMemGetInfo(&free_t,&total_t);
|
auto discard = hipMemGetInfo(&free_t,&total_t);
|
||||||
used_t=total_t-free_t;
|
used_t=total_t-free_t;
|
||||||
std::cout << " MemoryManager : GPU used "<<used_t<<" free "<<free_t<< " total "<<total_t<<std::endl;
|
std::cout << " MemoryManager : GPU used "<<used_t<<" free "<<free_t<< " total "<<total_t<<std::endl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user