OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 72 of file NvidiaKernel.h.

Constructor & Destructor Documentation

GpuCompilationContext::GpuCompilationContext ( )
inline

Definition at line 74 of file NvidiaKernel.h.

74 {}

Member Function Documentation

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

Definition at line 76 of file NvidiaKernel.h.

References contexts_per_device_.

76  {
77  contexts_per_device_.push_back(std::move(device_context));
78  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:97
std::pair<void*, void*> GpuCompilationContext::getNativeCode ( const size_t  device_id) const
inline

Definition at line 80 of file NvidiaKernel.h.

References CHECK_LT, and contexts_per_device_.

80  {
81  CHECK_LT(device_id, contexts_per_device_.size());
82  auto device_context = contexts_per_device_[device_id].get();
83  return std::make_pair<void*, void*>(device_context->kernel(),
84  device_context->module());
85  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:97
#define CHECK_LT(x, y)
Definition: Logger.h:299
std::vector<void*> GpuCompilationContext::getNativeFunctionPointers ( ) const
inline

Definition at line 87 of file NvidiaKernel.h.

References CHECK, and contexts_per_device_.

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

Member Data Documentation

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

Definition at line 97 of file NvidiaKernel.h.

Referenced by addDeviceCode(), getNativeCode(), and getNativeFunctionPointers().


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