A Modern GPGPU API & wip linux RDNA2+ Driver
rdna driver linux gpu
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

amdgpu: nop

+19
+15
drivers/amdgpu/cp_encoder.cpp
··· 1 1 #include "cp_encoder.h" 2 2 #include "cmdstream.h" 3 3 #include "gpuinfo.h" 4 + #include <cassert> 4 5 5 6 CPEncoder::CPEncoder(GpuInfo &info, uint8_t ip_type, CommandStream &cs) : info(info), ip_type(ip_type), cs(cs) {} 7 + 8 + void CPEncoder::nop(uint32_t count, uint32_t *content) { 9 + assert(count > 0, "CPEncoder::nop: count must always be >= 1"); 10 + cs.emit(PKT3(PKT3_NOP, 0, count-1)); 11 + if (content) { 12 + for (auto i = 0; i < count-1; ++i) { 13 + cs.emit(content[i]); 14 + } 15 + } else { 16 + for (auto i = 0; i < count-1; ++i) { 17 + cs.emit(0); 18 + } 19 + } 20 + } 6 21 7 22 void CPEncoder::wait_mem(WaitMemOp op, uint64_t va, uint32_t ref, uint32_t mask) { 8 23 cs.emit(PKT3(PKT3_WAIT_REG_MEM, 5, 0));
+4
drivers/amdgpu/cp_encoder.h
··· 11 11 public: 12 12 CPEncoder(GpuInfo &info, uint8_t ip_type, CommandStream &cs); 13 13 14 + // nops are variable length; we can write data here if we want 15 + // (scratch space for example). 16 + void nop(uint32_t count = 1, uint32_t *content = nullptr); 17 + 14 18 void wait_mem(WaitMemOp op, uint64_t va, uint32_t ref, uint32_t mask); 15 19 16 20 void release_mem(uint32_t event,