Arcane  v4.1.1.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
CudaAccelerator.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* CudaAccelerator.h (C) 2000-2025 */
9/* */
10/* Backend 'CUDA' pour les accélérateurs. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_CUDA_CUDAACCELERATOR_H
13#define ARCCORE_CUDA_CUDAACCELERATOR_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19#include <cuda_runtime.h>
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24#ifdef ARCCORE_COMPONENT_arcane_cuda
25#define ARCCORE_CUDA_EXPORT ARCCORE_EXPORT
26#else
27#define ARCCORE_CUDA_EXPORT ARCCORE_IMPORT
28#endif
29
30namespace Arcane::Accelerator::Cuda
31{
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36extern "C++" ARCCORE_CUDA_EXPORT void
37arcaneCheckCudaErrors(const TraceInfo& ti,cudaError_t e);
38
39extern "C++" ARCCORE_CUDA_EXPORT void
40arcaneCheckCudaErrorsNoThrow(const TraceInfo& ti,cudaError_t e);
41
43#define ARCCORE_CHECK_CUDA(result) \
44 Arcane::Accelerator::Cuda::arcaneCheckCudaErrors(A_FUNCINFO,result)
45
47#define ARCCORE_CHECK_CUDA_NOTHROW(result) \
48 Arcane::Accelerator::Cuda::arcaneCheckCudaErrorsNoThrow(A_FUNCINFO,result)
49
50#define ARCANE_CHECK_CUDA(result) ARCCORE_CHECK_CUDA((result))
51#define ARCANE_CHECK_CUDA_NOTHROW(result) ARCCORE_CHECK_CUDA_NOTHROW((result))
52
53/*---------------------------------------------------------------------------*/
54/*---------------------------------------------------------------------------*/
55
56#if defined(CUDART_VERSION) && CUDART_VERSION >= 13000
57#define ARCCORE_USING_CUDA13_OR_GREATER
58#define ARCANE_USING_CUDA13_OR_GREATER
59#endif
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64} // End namespace Arcane::accelerator::cuda
65
66/*---------------------------------------------------------------------------*/
67/*---------------------------------------------------------------------------*/
68
69#endif
Déclarations des types de la composante 'base' de Arccore.