3
// ************************************************************************
5
// Kokkos: Manycore Performance-Portable Multidimensional Arrays
6
// Copyright (2012) Sandia Corporation
8
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9
// the U.S. Government retains certain rights in this software.
11
// Redistribution and use in source and binary forms, with or without
12
// modification, are permitted provided that the following conditions are
15
// 1. Redistributions of source code must retain the above copyright
16
// notice, this list of conditions and the following disclaimer.
18
// 2. Redistributions in binary form must reproduce the above copyright
19
// notice, this list of conditions and the following disclaimer in the
20
// documentation and/or other materials provided with the distribution.
22
// 3. Neither the name of the Corporation nor the names of the
23
// contributors may be used to endorse or promote products derived from
24
// this software without specific prior written permission.
26
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov)
40
// ************************************************************************
44
#ifndef KOKKOS_CUDA_ABORT_HPP
45
#define KOKKOS_CUDA_ABORT_HPP
47
//----------------------------------------------------------------------------
48
//----------------------------------------------------------------------------
50
#if defined( __CUDACC__ ) && defined( __CUDA_ARCH__ )
54
#if ! defined( CUDA_VERSION ) || ( CUDA_VERSION < 4010 )
55
#error "Cuda version 4.1 or greater required"
58
#if ( __CUDA_ARCH__ < 200 )
59
#error "Cuda device capability 2.0 or greater required"
63
/* Cuda runtime function, declared in <crt/device_runtime.h>
64
* Requires capability 2.x or better.
66
extern __device__ void __assertfail(
78
void cuda_abort( const char * const message )
80
const char empty[] = "" ;
82
__assertfail( (const void *) message ,
83
(const void *) empty ,
85
(const void *) empty ,
96
KOKKOS_INLINE_FUNCTION
97
void cuda_abort( const char * const ) {}
101
#endif /* #if defined( __CUDACC__ ) && defined( __CUDA_ARCH__ ) */
103
//----------------------------------------------------------------------------
104
//----------------------------------------------------------------------------
106
#if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA )
109
void abort( const char * const message ) { Kokkos::Impl::cuda_abort(message); }
111
#endif /* defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA ) */
113
//----------------------------------------------------------------------------
114
//----------------------------------------------------------------------------
116
#endif /* #ifndef KOKKOS_CUDA_ABORT_HPP */