Apollo  6.0
Open source self driving car software
planning_block.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2019 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 <cuda_runtime.h>
20 
21 namespace apollo {
22 namespace planning {
23 
24 #define BLOCK_WIDTH 16
25 #define BLOCK_HEIGHT 16
26 
27 #define BLOCK_1 256
28 
29 #define TEMPLATE_ROUTINE_INSTANCE(ret, routine) template ret routine
30 
31 #define DATA_TRANSFER_INST(type) \
32  TEMPLATE_ROUTINE_INSTANCE( \
33  bool, data_transfer(type *dst, const type *src, const int size))
34 
35 #define CUDA_CHECK(call) \
36  { \
37  const cudaError_t error = call; \
38  if (error != cudaSuccess) { \
39  printf("Error: %s:%d, ", __FILE__, __LINE__); \
40  printf("code: %d, reasone: %s\n", error, cudaGetErrorString(error)); \
41  return false; \
42  } \
43  }
44 
45 bool InitialCuda();
46 
47 __global__ void fill_lower_left_gpu(int *iRow, int *jCol, unsigned int *rind_L,
48  unsigned int *cind_L, const int nnz_L);
49 
50 template <typename T>
51 __global__ void data_transfer_gpu(T *dst, const T *src, const int size);
52 
53 bool fill_lower_left(int *iRow, int *jCol, unsigned int *rind_L,
54  unsigned int *cind_L, const int nnz_L);
55 template <typename T>
56 bool data_transfer(T *dst, const T *src, const int size);
57 
58 } // namespace planning
59 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
bool fill_lower_left(int *iRow, int *jCol, unsigned int *rind_L, unsigned int *cind_L, const int nnz_L)
Planning module main class. It processes GPS and IMU as input, to generate planning info...
__global__ void data_transfer_gpu(T *dst, const T *src, const int size)
__global__ void fill_lower_left_gpu(int *iRow, int *jCol, unsigned int *rind_L, unsigned int *cind_L, const int nnz_L)
bool data_transfer(T *dst, const T *src, const int size)