// TODO: Consider turning on by default when we can detect nr of streams.
pmeGpu->archSpecific->useTiming = (getenv("GMX_ENABLE_GPU_TIMING") != nullptr);
+ // Prepare to use the device that this PME task was assigned earlier.
+ CU_RET_ERR(cudaSetDevice(pmeGpu->deviceInfo->id), "Switching to PME CUDA device");
+
pmeGpu->maxGridWidthX = pmeGpu->deviceInfo->prop.maxGridSize[0];
/* Creating a PME CUDA stream */
)
{
const MDLogger dummyLogger;
- if (gpuInfo)
- {
- init_gpu(dummyLogger, gpuInfo);
- }
const auto runMode = (mode == CodePath::CPU) ? PmeRunMode::CPU : PmeRunMode::GPU;
t_commrec dummyCommrec = {0};
NumPmeDomains numPmeDomains = { 1, 1 };
// PME can only run on the CPU, so don't make any more test contexts.
return;
}
+ const MDLogger dummyLogger;
// Constructing contexts for all compatible GPUs - will be empty on non-GPU builds
for (int gpuIndex : getCompatibleGpus(hardwareInfo_->gpu_info))
{
+ gmx_device_info_t *deviceInfo = getDeviceInfo(hardwareInfo_->gpu_info, gpuIndex);
+ init_gpu(dummyLogger, deviceInfo);
+
char stmp[200] = {};
get_gpu_device_info_string(stmp, hardwareInfo_->gpu_info, gpuIndex);
std::string description = "(GPU " + std::string(stmp) + ") ";
// TODO should this be CodePath::GPU?
- hardwareContexts_.emplace_back(TestHardwareContext(CodePath::CUDA, description.c_str(), getDeviceInfo(hardwareInfo_->gpu_info, gpuIndex)));
+ hardwareContexts_.emplace_back(TestHardwareContext(CodePath::CUDA, description.c_str(), deviceInfo));
}
}