buf.copyOut(tc->getMemProxy());
}
break;
+ case HSA_GET_HW_STATIC_CONTEXT_SIZE:
+ {
+ BufferArg buf(buf_addr, sizeof(uint32_t));
+ *((uint32_t*)buf.bufferPtr()) = dispatcher->getStaticContextSize();
+ buf.copyOut(tc->getMemProxy());
+ }
+ break;
default:
fatal("ClDriver: bad ioctl %d\n", req);
{
shader->funcargs_size = funcargs_size;
}
+
+uint32_t
+GPUDispatcher::getStaticContextSize() const
+{
+ return shader->cuList[0]->wfList[0][0]->getStaticContextSize();
+}
int getNumCUs();
int wfSize() const;
void setFuncargsSize(int funcargs_size);
+
+ /** Returns the size of the static hardware context of a wavefront */
+ uint32_t getStaticContextSize() const;
};
#endif // __GPU_DISPATCHER_HH__
static const int HSA_GET_READONLY_DATA = 0x4805;
static const int HSA_GET_CU_CNT = 0x4806;
static const int HSA_GET_VSZ = 0x4807;
+static const int HSA_GET_HW_STATIC_CONTEXT_SIZE = 0x4808;
// Return value (via buffer ptr) for HSA_GET_SIZES
struct HsaDriverSizes
}
void
-Wavefront::start(uint64_t _wfDynId,uint64_t _base_ptr)
+Wavefront::start(uint64_t _wf_dyn_id,uint64_t _base_ptr)
{
- wfDynId = _wfDynId;
+ wfDynId = _wf_dyn_id;
basePtr = _base_ptr;
status = S_RUNNING;
}
{
reconvergenceStack.top()->pc = new_pc;
}
+
+uint32_t
+Wavefront::getStaticContextSize() const
+{
+ return barCnt.size() * sizeof(int) + sizeof(dynWaveId) + sizeof(maxBarCnt) +
+ sizeof(oldBarrierCnt) + sizeof(barrierCnt) + sizeof(wgId) +
+ sizeof(computeUnit->cu_id) + sizeof(barrierId) + sizeof(initMask) +
+ sizeof(privBase) + sizeof(spillBase) + sizeof(ldsChunk) +
+ computeUnit->wfSize() * sizeof(ReconvergenceStackEntry);
+}
void discardFetch();
+ /**
+ * Returns the size of the static hardware context of a particular wavefront
+ * This should be updated everytime the context is changed
+ */
+ uint32_t getStaticContextSize() const;
+
private:
/**
* Stack containing Control Flow Graph nodes (i.e., kernel instructions)