OmniSciDB  72c90bc290
 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
 
std::string const & name (size_t const device_id) const
 
size_t getMemSize () const
 
- Public Member Functions inherited from CompilationContext
virtual ~CompilationContext ()
 
size_t size () const
 

Private Attributes

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

Detailed Description

Definition at line 78 of file NvidiaKernel.h.

Constructor & Destructor Documentation

GpuCompilationContext::GpuCompilationContext ( )
inline

Definition at line 80 of file NvidiaKernel.h.

80 {}

Member Function Documentation

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

Definition at line 82 of file NvidiaKernel.h.

References contexts_per_device_.

82  {
83  contexts_per_device_.push_back(std::move(device_context));
84  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:112
size_t GpuCompilationContext::getMemSize ( ) const
inlinevirtual

Implements CompilationContext.

Definition at line 107 of file NvidiaKernel.h.

References contexts_per_device_.

107  {
108  return contexts_per_device_.begin()->get()->getModuleSize();
109  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:112
std::pair<void*, void*> GpuCompilationContext::getNativeCode ( const size_t  device_id) const
inline

Definition at line 86 of file NvidiaKernel.h.

References CHECK_LT, and contexts_per_device_.

86  {
87  CHECK_LT(device_id, contexts_per_device_.size());
88  auto device_context = contexts_per_device_[device_id].get();
89  return std::make_pair<void*, void*>(device_context->kernel(),
90  device_context->module());
91  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:112
#define CHECK_LT(x, y)
Definition: Logger.h:303
std::vector<void*> GpuCompilationContext::getNativeFunctionPointers ( ) const
inline

Definition at line 93 of file NvidiaKernel.h.

References CHECK, and contexts_per_device_.

93  {
94  std::vector<void*> fn_ptrs;
95  for (auto& device_context : contexts_per_device_) {
96  CHECK(device_context);
97  fn_ptrs.push_back(device_context->kernel());
98  }
99  return fn_ptrs;
100  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:112
#define CHECK(condition)
Definition: Logger.h:291
std::string const& GpuCompilationContext::name ( size_t const  device_id) const
inline

Definition at line 102 of file NvidiaKernel.h.

References CHECK_LT, and contexts_per_device_.

102  {
103  CHECK_LT(device_id, contexts_per_device_.size());
104  return contexts_per_device_[device_id]->name();
105  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:112
#define CHECK_LT(x, y)
Definition: Logger.h:303

Member Data Documentation

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

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