OmniSciDB  a5dc49c757
 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 87 of file NvidiaKernel.h.

Constructor & Destructor Documentation

GpuCompilationContext::GpuCompilationContext ( )
inline

Definition at line 89 of file NvidiaKernel.h.

89 {}

Member Function Documentation

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

Definition at line 91 of file NvidiaKernel.h.

References contexts_per_device_.

91  {
92  contexts_per_device_.push_back(std::move(device_context));
93  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:121
size_t GpuCompilationContext::getMemSize ( ) const
inlinevirtual

Implements CompilationContext.

Definition at line 116 of file NvidiaKernel.h.

References contexts_per_device_.

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

Definition at line 95 of file NvidiaKernel.h.

References CHECK_LT, and contexts_per_device_.

95  {
96  CHECK_LT(device_id, contexts_per_device_.size());
97  auto device_context = contexts_per_device_[device_id].get();
98  return std::make_pair<void*, void*>(device_context->kernel(),
99  device_context->module());
100  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:121
#define CHECK_LT(x, y)
Definition: Logger.h:303
std::vector<void*> GpuCompilationContext::getNativeFunctionPointers ( ) const
inline

Definition at line 102 of file NvidiaKernel.h.

References CHECK, and contexts_per_device_.

102  {
103  std::vector<void*> fn_ptrs;
104  for (auto& device_context : contexts_per_device_) {
105  CHECK(device_context);
106  fn_ptrs.push_back(device_context->kernel());
107  }
108  return fn_ptrs;
109  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:121
#define CHECK(condition)
Definition: Logger.h:291
std::string const& GpuCompilationContext::name ( size_t const  device_id) const
inline

Definition at line 111 of file NvidiaKernel.h.

References CHECK_LT, and contexts_per_device_.

111  {
112  CHECK_LT(device_id, contexts_per_device_.size());
113  return contexts_per_device_[device_id]->name();
114  }
std::vector< std::unique_ptr< GpuDeviceCompilationContext > > contexts_per_device_
Definition: NvidiaKernel.h:121
#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: