-
Notifications
You must be signed in to change notification settings - Fork 555
Expand file tree
/
Copy pathkernel_type.hpp
More file actions
37 lines (32 loc) · 1.22 KB
/
Copy pathkernel_type.hpp
File metadata and controls
37 lines (32 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#pragma once
namespace arrayfire {
namespace common {
/// \brief Maps a type between its data representation and the type used
/// during compute operations
///
/// This struct defines two types. The data type is used to reference the
/// data of an array. The compute type will be used during the computation.
/// The kernel is responsible for converting from the data type to the
/// computation type.
/// For most types these types will be the same. For fp16 type the compute
/// type will be float on platforms that don't support 16 bit floating point
/// operations.
template<typename T>
struct kernel_type {
/// The type used to represent the data values
using data = T;
/// The type used when performing a computation
using compute = T;
/// The type defined by the compute framework for this type
using native = compute;
};
} // namespace common
} // namespace arrayfire