30 m_kernelName =
String(
"fermi_kdtree_while_while_leafRef");
106 int desiredWarps = (rays.
getSize() + 31) / 32;
114 int blockWarps = (blockSize.x * blockSize.y + 31) / 32;
115 int numBlocks = (desiredWarps + blockWarps - 1) / blockWarps;
118 return kernel.
launchTimed(numBlocks * blockSize.x * blockSize.y, blockSize);
124 CudaModule* CudaKDTreeTracer::compileKernel(
void)
CudaKDTreeTracer(void)
Constructor.
FW_CUDA_FUNC T length(const VectorBase< T, L, S > &v)
S32 getSize() const
Gets size of the buffer (number of rays).
const char * getPtr(void) const
Buffer & getTriIndexBuffer(void)
Returns triangle index buffer.
FW_CUDA_FUNC const Vec3f & max(void) const
CudaModule * compile(bool enablePrints=true, bool autoFail=true)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule * module
CUdeviceptr getCudaPtr(S64 ofs=0)
CudaKernel getKernel(const String &name)
Buffer & getTriWoopBuffer(void)
Returns buffer of woopified triangles.
const U8 * getPtr(S64 ofs=0)
Buffer & getRayBuffer()
Gets ray buffer.
bool getNeedClosestHit() const
Returns whether the closest hit is needed.
void setTexRef(const String &name, Buffer &buf, CUarray_format format, int numComponents)
CUdeviceptr getMutableCudaPtr(S64 ofs=0)
Buffer & getResultBuffer()
Gets ray result buffer.
Ray buffer class. Stores rays.
U8 * getMutablePtr(S64 ofs=0)
FW_CUDA_FUNC const Vec3f & min(void) const
String sprintf(const char *fmt,...)
Definitions for the Cuda KDTree Tracer.
FW_CUDA_FUNC const F32 * getPtr(void) const
Buffer & getGlobal(const String &name)
CudaKernel & setParams(const void *ptr, int size)
Buffer & getNodeBuffer(void)
Returns node buffer.
void setKernel(const String &kernelName)
Sets kernel that should perform the actual traversation of the k-d tree on the gpu.
CudaKernel & launch(void)
F32 launchTimed(bool yield=true)
static void staticInit(void)
F32 traceBatch(RayBuffer &rays)
Traces given batch of rays.
void addOptions(const String &options)
void setSourceFile(const String &path)
~CudaKDTreeTracer(void)
Destructor.