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 38 39 40 41 42 43 44 45 46 47 48 49
|
/*
* GridTools
*
* Copyright (c) 2014-2023, ETH Zurich
* All rights reserved.
*
* Please, refer to the LICENSE file in the root directory.
* SPDX-License-Identifier: BSD-3-Clause
*/
#pragma once
#include <gridtools/gcl/low_level/arch.hpp>
#if defined(GT_GCL_GPU)
#ifndef GT_STORAGE_GPU
#define GT_STORAGE_GPU
#endif
#ifndef GT_TIMER_CUDA
#define GT_TIMER_CUDA
#endif
namespace {
using gcl_arch_t = gridtools::gcl::gpu;
}
#elif defined(GT_GCL_CPU)
#ifndef GT_STORAGE_CPU_IFIRST
#define GT_STORAGE_CPU_IFIRST
#endif
#ifndef GT_TIMER_OMP
#define GT_TIMER_OMP
#endif
namespace {
using gcl_arch_t = gridtools::gcl::cpu;
}
#endif
#include "storage_select.hpp"
#include "timer_select.hpp"
namespace gridtools {
namespace gcl {
storage::cpu_ifirst backend_storage_traits(cpu const &);
timer_omp backend_timer_impl(cpu const &);
inline char const *backend_name(cpu const &) { return "cpu"; }
storage::gpu backend_storage_traits(gpu const &);
timer_cuda backend_timer_impl(gpu const &);
inline char const *backend_name(gpu const &) { return "gpu"; }
} // namespace gcl
} // namespace gridtools
|