Caffe2 - C++ API
A deep learning, cross platform ML framework
Related Pages
Modules
Data Structures
Files
C++ API
Python API
GitHub
File List
Globals
aten
src
ATen
cuda
Array.h
1
#pragma once
2
3
// A fixed-size array type usable from CUDA kernels.
4
5
#include <c10/macros/Macros.h>
6
7
namespace
at
{
namespace
cuda {
8
9
template
<
typename
T,
int
size>
10
struct
alignas
(16)
Array
{
11
T
data[size];
12
13
C10_HOST_DEVICE
T
operator[](
int
i)
const
{
14
return
data[i];
15
}
16
C10_HOST_DEVICE
T
& operator[](
int
i) {
17
return
data[i];
18
}
19
20
C10_HIP_HOST_DEVICE
Array
() =
default
;
21
C10_HIP_HOST_DEVICE
Array
(
const
Array
&) =
default
;
22
C10_HIP_HOST_DEVICE
Array
& operator=(
const
Array
&) =
default
;
23
24
// Fill the array with x.
25
C10_HOST_DEVICE
Array
(
T
x) {
26
for
(
int
i = 0; i < size; i++) {
27
data[i] = x;
28
}
29
}
30
};
31
32
}}
T
Definition:
dataloader.cpp:482
at::cuda::Array
Definition:
Array.h:10
at
Flush-To-Zero and Denormals-Are-Zero mode.
Definition:
AccumulateType.h:17
Generated on Thu Mar 21 2019 13:06:08 for Caffe2 - C++ API by
1.8.11