diff --git a/src/gpu-compute/gpu_exec_context.hh b/src/gpu-compute/gpu_exec_context.hh --- a/src/gpu-compute/gpu_exec_context.hh +++ b/src/gpu-compute/gpu_exec_context.hh @@ -55,7 +55,7 @@ protected: ComputeUnit *cu; Wavefront *wf; - TheGpuISA::GPUISA &gpuISA; + TheGpuISA::GPUISA *gpuISA; }; #endif // __GPU_EXEC_CONTEXT_HH__ # Node ID b236bb4bd2ceaa6fb4d4d9b1b236e2c3d6922ac9 # Parent 4de58b836e6feea857240d3c87adf128e8d0e642 diff --git a/src/gpu-compute/gpu_exec_context.cc b/src/gpu-compute/gpu_exec_context.cc --- a/src/gpu-compute/gpu_exec_context.cc +++ b/src/gpu-compute/gpu_exec_context.cc @@ -37,7 +37,7 @@ #include "gpu-compute/wavefront.hh" GPUExecContext::GPUExecContext(ComputeUnit *_cu, Wavefront *_wf) - : cu(_cu), wf(_wf), gpuISA(_wf->gpuISA()) + : cu(_cu), wf(_wf), gpuISA(_wf ? &_wf->gpuISA() : nullptr) { } @@ -56,11 +56,13 @@ TheGpuISA::MiscReg GPUExecContext::readMiscReg(int opIdx) const { - return gpuISA.readMiscReg(opIdx); + assert(gpuISA); + return gpuISA->readMiscReg(opIdx); } void GPUExecContext::writeMiscReg(int opIdx, TheGpuISA::MiscReg operandVal) { - gpuISA.writeMiscReg(opIdx, operandVal); + assert(gpuISA); + gpuISA->writeMiscReg(opIdx, operandVal); }