Files
rocm-systems/include/hip/hcc_detail/host_defines.h
T
Sun, Peng 329e2182d6 revert workaround for square sample and update doc on GGL
Change-Id: I731c68ca4111e7dc2e45bef51c4cad2c23fc81f8
2017-03-21 10:26:09 -05:00

89 lines
2.3 KiB
C

/*
Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/**
* @file hcc_detail/host_defines.h
* @brief TODO-doc
*/
#ifndef HOST_DEFINES_H
#define HOST_DEFINES_H
#define USE_PROMOTE_FREE_HCC 0
// Add guard to Generic Grid Launch method
#ifndef GENERIC_GRID_LAUNCH
#define GENERIC_GRID_LAUNCH 0
#endif
#ifdef __HCC__
/**
* Function and kernel markers
*/
#define __host__ __attribute__((cpu))
#define __device__ __attribute__((hc))
//#warning "HOST DEFINE header included"
#if GENERIC_GRID_LAUNCH == 0
//#warning "original global define reached"
#define __global__ __attribute__((hc_grid_launch)) __attribute__((used))
#else
//#warning "GGL global define reached"
#define __global__ [[hc]] __attribute__((weak))
#endif //GENERIC_GRID_LAUNCH
#define __noinline__ __attribute__((noinline))
#define __forceinline__ __attribute__((always_inline))
/*
* Variable Type Qualifiers:
*/
// _restrict is supported by the compiler
#define __shared__ tile_static
#if USE_PROMOTE_FREE_HCC==1
#define __constant__ __attribute__((hc))
#else
#define __constant__ ADDRESS_SPACE_1
#endif
#else
// Non-HCC compiler
/**
* Function and kernel markers
*/
#define __host__
#define __device__
#define __global__
#define __noinline__
#define __forceinline__
#define __shared__
#define __constant__
#endif
#endif