OmniSciDB  baf940c279
GpuCompilationContext Class Reference

#include <NvidiaKernel.h>

+ Inheritance diagram for GpuCompilationContext:
+ Collaboration diagram for GpuCompilationContext:

Public Member Functions

 GpuCompilationContext ()
 
void addDeviceCode (std::unique_ptr< GpuDeviceCompilationContext > &&device_context)
 
std::pair< void *, void * > getNativeCode (const size_t device_id) const
 
std::vector< void * > getNativeFunctionPointers () const
 
- Public Member Functions inherited from CompilationContext
virtual ~CompilationContext ()
 

Private Attributes

std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
 

Detailed Description

Definition at line 73 of file NvidiaKernel.h.

Constructor & Destructor Documentation

◆ GpuCompilationContext()

GpuCompilationContext::GpuCompilationContext ( )
inline

Definition at line 75 of file NvidiaKernel.h.

75 {}

Member Function Documentation

◆ addDeviceCode()

void GpuCompilationContext::addDeviceCode ( std::unique_ptr< GpuDeviceCompilationContext > &&  device_context)
inline

Definition at line 77 of file NvidiaKernel.h.

77  {
78  contexts_per_device_.push_back(std::move(device_context));
79  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:98

◆ getNativeCode()

std::pair<void*, void*> GpuCompilationContext::getNativeCode ( const size_t  device_id) const
inline

Definition at line 81 of file NvidiaKernel.h.

References CHECK_LT.

Referenced by QueryExecutionContext::launchGpuCode().

81  {
82  CHECK_LT(device_id, contexts_per_device_.size());
83  auto device_context = contexts_per_device_[device_id].get();
84  return std::make_pair<void*, void*>(device_context->kernel(),
85  device_context->module());
86  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:98
#define CHECK_LT(x, y)
Definition: Logger.h:207
+ Here is the caller graph for this function:

◆ getNativeFunctionPointers()

std::vector<void*> GpuCompilationContext::getNativeFunctionPointers ( ) const
inline

Definition at line 88 of file NvidiaKernel.h.

References CHECK.

88  {
89  std::vector<void*> fn_ptrs;
90  for (auto& device_context : contexts_per_device_) {
91  CHECK(device_context);
92  fn_ptrs.push_back(device_context->kernel());
93  }
94  return fn_ptrs;
95  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:98
#define CHECK(condition)
Definition: Logger.h:197

Member Data Documentation

◆ contexts_per_device_

std::vector<std::unique_ptr<GpuDeviceCompilationContext> > GpuCompilationContext::contexts_per_device_
private

Definition at line 98 of file NvidiaKernel.h.


The documentation for this class was generated from the following file: