Apollo  6.0
Open source self driving car software
cuda_util.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 The Apollo Authors. All Rights Reserved.
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 <cublas_v2.h>
20 
21 namespace apollo {
22 namespace perception {
23 namespace inference {
24 
25 class CudaUtil {
26  public:
27  static bool set_device_id(int device_id);
28  static cublasHandle_t& get_handler();
29  ~CudaUtil();
30 
31  private:
32  CudaUtil();
33  static CudaUtil& get();
34  cublasHandle_t cublas_handle_;
35 };
36 
37 } // namespace inference
38 } // namespace perception
39 } // namespace apollo
static bool set_device_id(int device_id)
static cublasHandle_t & get_handler()
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: cuda_util.h:25