triro 1.3.0
A Python Ray-Mesh Intersector in OptiX
Loading...
Searching...
No Matches
hmesh Namespace Reference

Classes

struct  CUDABuffer
 
struct  LaunchParams
 
struct  LPResult
 
struct  OptixAccelStructureWrapperCPP
 
struct  RayInput
 
struct  vec
 

Typedefs

using vec2i = vec< int32_t, 2 >
 
using vec2f = vec< float, 2 >
 
using vec3i = vec< int32_t, 3 >
 
using vec3f = vec< float, 3 >
 

Functions

void initOptix ()
 
void createOptixContext ()
 
void createOptixModule ()
 
void createPipelines ()
 
void buildSBT ()
 
torch::Tensor intersectsAny (OptixAccelStructureWrapperCPP as, const torch::Tensor &origins, const torch::Tensor &dirs)
 
torch::Tensor intersectsFirst (OptixAccelStructureWrapperCPP as, const torch::Tensor &origins, const torch::Tensor &dirs)
 
std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > intersectsClosest (OptixAccelStructureWrapperCPP as, torch::Tensor origins, torch::Tensor directions)
 Find if ray hits any triangle and return ray index, triangle index, hit location and uv.
 
torch::Tensor intersectsCount (OptixAccelStructureWrapperCPP as, torch::Tensor origins, torch::Tensor directions)
 
std::tuple< torch::Tensor, torch::Tensor, torch::Tensor > intersectsLocation (OptixAccelStructureWrapperCPP as, torch::Tensor origins, torch::Tensor directions)
 
template<typename... Ts>
bool tensorInputCheck (Ts... ts)
 
std::vector< int64_t > removeLastDim (const c10::IntArrayRef dims)
 
size_t prod (const std::vector< int64_t > &dims)
 
std::vector< int64_t > changeLastDim (const c10::IntArrayRef dims, size_t value)
 
template<typename T >
T * data_ptr (const torch::Tensor &t)
 
template<typename T >
void fillArray (T *dst, c10::ArrayRef< T > src, T defaultValue)
 

Variables

CUcontext cuCtx
 
CUstream cuStream
 
OptixDeviceContext optixContext
 
OptixModule optixModule
 
OptixPipelineCompileOptions pipelineCompileOptions = {}
 
OptixShaderBindingTable sbts [SBTType::count]
 
OptixPipeline optixPipelines [SBTType::count]
 
OptixProgramGroup optixProgramGroups [SBTType::count][3]
 
constexpr int MAX_ANYHIT_SIZE = 8
 
constexpr int MAX_SIZE_LENGTH = 4
 

Typedef Documentation

◆ vec2f

using hmesh::vec2f = typedef vec<float, 2>

Definition at line 10 of file type.h.

◆ vec2i

using hmesh::vec2i = typedef vec<int32_t, 2>

Definition at line 9 of file type.h.

◆ vec3f

using hmesh::vec3f = typedef vec<float, 3>

Definition at line 12 of file type.h.

◆ vec3i

using hmesh::vec3i = typedef vec<int32_t, 3>

Definition at line 11 of file type.h.

Function Documentation

◆ buildSBT()

void hmesh::buildSBT ( )

Definition at line 134 of file base.cpp.

◆ changeLastDim()

std::vector< int64_t > hmesh::changeLastDim ( const c10::IntArrayRef  dims,
size_t  value 
)
inline

Definition at line 138 of file ray.cpp.

◆ createOptixContext()

void hmesh::createOptixContext ( )

Definition at line 33 of file base.cpp.

◆ createOptixModule()

void hmesh::createOptixModule ( )

Definition at line 43 of file base.cpp.

◆ createPipelines()

void hmesh::createPipelines ( )

Definition at line 77 of file base.cpp.

◆ data_ptr()

template<typename T >
T * hmesh::data_ptr ( const torch::Tensor &  t)
inline

Definition at line 147 of file ray.cpp.

◆ fillArray()

template<typename T >
void hmesh::fillArray ( T *  dst,
c10::ArrayRef< T >  src,
defaultValue 
)

Definition at line 152 of file ray.cpp.

◆ initOptix()

void hmesh::initOptix ( )

Definition at line 31 of file base.cpp.

◆ intersectsAny()

torch::Tensor hmesh::intersectsAny ( OptixAccelStructureWrapperCPP  as,
const torch::Tensor &  origins,
const torch::Tensor &  dirs 
)
extern

Definition at line 161 of file ray.cpp.

◆ intersectsClosest()

std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > hmesh::intersectsClosest ( OptixAccelStructureWrapperCPP  as,
torch::Tensor  origins,
torch::Tensor  directions 
)
extern

Find if ray hits any triangle and return ray index, triangle index, hit location and uv.

Parameters
as
origins
directions
Returns
std::tuple<torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor>

Definition at line 233 of file ray.cpp.

◆ intersectsCount()

torch::Tensor hmesh::intersectsCount ( OptixAccelStructureWrapperCPP  as,
torch::Tensor  origins,
torch::Tensor  directions 
)
extern

Definition at line 291 of file ray.cpp.

◆ intersectsFirst()

torch::Tensor hmesh::intersectsFirst ( OptixAccelStructureWrapperCPP  as,
const torch::Tensor &  origins,
const torch::Tensor &  dirs 
)
extern

Definition at line 191 of file ray.cpp.

◆ intersectsLocation()

std::tuple< torch::Tensor, torch::Tensor, torch::Tensor > hmesh::intersectsLocation ( OptixAccelStructureWrapperCPP  as,
torch::Tensor  origins,
torch::Tensor  directions 
)
extern

Definition at line 325 of file ray.cpp.

◆ prod()

size_t hmesh::prod ( const std::vector< int64_t > &  dims)
inline

Definition at line 131 of file ray.cpp.

◆ removeLastDim()

std::vector< int64_t > hmesh::removeLastDim ( const c10::IntArrayRef  dims)
inline

Definition at line 125 of file ray.cpp.

◆ tensorInputCheck()

template<typename... Ts>
bool hmesh::tensorInputCheck ( Ts...  ts)
inline

Definition at line 104 of file ray.cpp.

Variable Documentation

◆ cuCtx

CUcontext hmesh::cuCtx

Definition at line 15 of file base.cpp.

◆ cuStream

CUstream hmesh::cuStream

Definition at line 16 of file base.cpp.

◆ MAX_ANYHIT_SIZE

constexpr int hmesh::MAX_ANYHIT_SIZE = 8
constexpr

Definition at line 8 of file LaunchParams.h.

◆ MAX_SIZE_LENGTH

constexpr int hmesh::MAX_SIZE_LENGTH = 4
constexpr

Definition at line 9 of file LaunchParams.h.

◆ optixContext

OptixDeviceContext hmesh::optixContext

Definition at line 17 of file base.cpp.

◆ optixModule

OptixModule hmesh::optixModule

Definition at line 18 of file base.cpp.

◆ optixPipelines

OptixPipeline hmesh::optixPipelines

Definition at line 23 of file base.cpp.

◆ optixProgramGroups

OptixProgramGroup hmesh::optixProgramGroups[SBTType::count][3]

Definition at line 24 of file base.cpp.

◆ pipelineCompileOptions

OptixPipelineCompileOptions hmesh::pipelineCompileOptions = {}

Definition at line 19 of file base.cpp.

◆ sbts

OptixShaderBindingTable hmesh::sbts

Definition at line 22 of file base.cpp.