OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DeviceKernel.h
Go to the documentation of this file.
1 /*
2  * Copyright 2021 OmniSci, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <memory>
20 
21 class CompilationContext;
22 
23 class DeviceClock {
24  public:
25  virtual void start() = 0;
26  virtual int stop() = 0;
27 
28  virtual ~DeviceClock() = default;
29 };
30 
31 class DeviceKernel {
32  public:
33  virtual void launch(unsigned int gridDimX,
34  unsigned int gridDimY,
35  unsigned int gridDimZ,
36  unsigned int blockDimX,
37  unsigned int blockDimY,
38  unsigned int blockDimZ,
39  unsigned int sharedMemBytes,
40  void** kernelParams) = 0;
41 
42  virtual void initializeDynamicWatchdog(bool could_interrupt, uint64_t cycle_budget) = 0;
43  virtual void initializeRuntimeInterrupter() = 0;
44 
45  virtual std::unique_ptr<DeviceClock> make_clock() = 0;
46 
47  virtual ~DeviceKernel() = default;
48 };
49 
50 std::unique_ptr<DeviceKernel> create_device_kernel(const CompilationContext* ctx,
51  int device_id);
virtual int stop()=0
virtual std::unique_ptr< DeviceClock > make_clock()=0
virtual ~DeviceKernel()=default
virtual void launch(unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, void **kernelParams)=0
virtual ~DeviceClock()=default
virtual void initializeDynamicWatchdog(bool could_interrupt, uint64_t cycle_budget)=0
virtual void initializeRuntimeInterrupter()=0
virtual void start()=0
std::unique_ptr< DeviceKernel > create_device_kernel(const CompilationContext *ctx, int device_id)