HIP: Heterogenous-computing Interface for Portability
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
external
hip
hip
include
hip
hcc_detail
hip_ldg.h
1
/*
2
Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved.
3
4
Permission is hereby granted, free of charge, to any person obtaining a copy
5
of this software and associated documentation files (the "Software"), to deal
6
in the Software without restriction, including without limitation the rights
7
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
copies of the Software, and to permit persons to whom the Software is
9
furnished to do so, subject to the following conditions:
10
11
The above copyright notice and this permission notice shall be included in
12
all copies or substantial portions of the Software.
13
14
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
THE SOFTWARE.
21
*/
22
23
#ifndef HIP_INCLUDE_HIP_HCC_DETAIL_HIP_LDG_H
24
#define HIP_INCLUDE_HIP_HCC_DETAIL_HIP_LDG_H
25
26
#if defined(__HCC_OR_HIP_CLANG__)
27
#if __hcc_workweek__ >= 16164 || __HIP_CLANG_ONLY__
28
#include "hip_vector_types.h"
29
#include "
host_defines.h
"
30
31
__device__
inline
static
char
__ldg(
const
char
* ptr) {
return
*ptr; }
32
33
__device__
inline
static
char2 __ldg(
const
char2* ptr) {
return
*ptr; }
34
35
__device__
inline
static
char4 __ldg(
const
char4* ptr) {
return
*ptr; }
36
37
__device__
inline
static
signed
char
__ldg(
const
signed
char
* ptr) {
return
ptr[0]; }
38
39
__device__
inline
static
unsigned
char
__ldg(
const
unsigned
char
* ptr) {
return
ptr[0]; }
40
41
42
__device__
inline
static
short
__ldg(
const
short
* ptr) {
return
ptr[0]; }
43
44
__device__
inline
static
short2 __ldg(
const
short2* ptr) {
return
ptr[0]; }
45
46
__device__
inline
static
short4 __ldg(
const
short4* ptr) {
return
ptr[0]; }
47
48
__device__
inline
static
unsigned
short
__ldg(
const
unsigned
short
* ptr) {
return
ptr[0]; }
49
50
51
__device__
inline
static
int
__ldg(
const
int
* ptr) {
return
ptr[0]; }
52
53
__device__
inline
static
int2 __ldg(
const
int2* ptr) {
return
ptr[0]; }
54
55
__device__
inline
static
int4 __ldg(
const
int4* ptr) {
return
ptr[0]; }
56
57
__device__
inline
static
unsigned
int
__ldg(
const
unsigned
int
* ptr) {
return
ptr[0]; }
58
59
60
__device__
inline
static
long
__ldg(
const
long
* ptr) {
return
ptr[0]; }
61
62
__device__
inline
static
unsigned
long
__ldg(
const
unsigned
long
* ptr) {
return
ptr[0]; }
63
64
65
__device__
inline
static
long
long
__ldg(
const
long
long
* ptr) {
return
ptr[0]; }
66
67
__device__
inline
static
longlong2 __ldg(
const
longlong2* ptr) {
return
ptr[0]; }
68
69
__device__
inline
static
unsigned
long
long
__ldg(
const
unsigned
long
long
* ptr) {
return
ptr[0]; }
70
71
72
__device__
inline
static
uchar2 __ldg(
const
uchar2* ptr) {
return
ptr[0]; }
73
74
__device__
inline
static
uchar4 __ldg(
const
uchar4* ptr) {
return
ptr[0]; }
75
76
77
__device__
inline
static
ushort2 __ldg(
const
ushort2* ptr) {
return
ptr[0]; }
78
79
80
__device__
inline
static
uint2 __ldg(
const
uint2* ptr) {
return
ptr[0]; }
81
82
__device__
inline
static
uint4 __ldg(
const
uint4* ptr) {
return
ptr[0]; }
83
84
85
__device__
inline
static
ulonglong2 __ldg(
const
ulonglong2* ptr) {
return
ptr[0]; }
86
87
88
__device__
inline
static
float
__ldg(
const
float
* ptr) {
return
ptr[0]; }
89
90
__device__
inline
static
float2 __ldg(
const
float2* ptr) {
return
ptr[0]; }
91
92
__device__
inline
static
float4 __ldg(
const
float4* ptr) {
return
ptr[0]; }
93
94
95
__device__
inline
static
double
__ldg(
const
double
* ptr) {
return
ptr[0]; }
96
97
__device__
inline
static
double2 __ldg(
const
double2* ptr) {
return
ptr[0]; }
98
99
#endif // __hcc_workweek__ || __HIP_CLANG_ONLY__
100
101
#endif // defined(__HCC_OR_HIP_CLANG__)
102
103
#endif // HIP_LDG_H
host_defines.h
TODO-doc.
Generated on Tue Oct 1 2019 18:37:59 for HIP: Heterogenous-computing Interface for Portability by
1.8.11