-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
166 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//@HEADER | ||
// ************************************************************************ | ||
// | ||
// Kokkos v. 4.0 | ||
// Copyright (2022) National Technology & Engineering | ||
// Solutions of Sandia, LLC (NTESS). | ||
// | ||
// Under the terms of Contract DE-NA0003525 with NTESS, | ||
// the U.S. Government retains certain rights in this software. | ||
// | ||
// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://kokkos.org/LICENSE for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//@HEADER | ||
#include <Kokkos_Core.hpp> | ||
#include <KokkosKernels_config.h> | ||
#include <KokkosLapack_Cuda_tpl.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
//@HEADER | ||
// ************************************************************************ | ||
// | ||
// Kokkos v. 4.0 | ||
// Copyright (2022) National Technology & Engineering | ||
// Solutions of Sandia, LLC (NTESS). | ||
// | ||
// Under the terms of Contract DE-NA0003525 with NTESS, | ||
// the U.S. Government retains certain rights in this software. | ||
// | ||
// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://kokkos.org/LICENSE for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//@HEADER | ||
#ifndef KOKKOSLAPACK_CUDA_TPL_HPP_ | ||
#define KOKKOSLAPACK_CUDA_TPL_HPP_ | ||
|
||
#if defined(KOKKOSKERNELS_ENABLE_TPL_CUSOLVER) | ||
#include <KokkosLapack_tpl_spec.hpp> | ||
|
||
namespace KokkosLapack { | ||
namespace Impl { | ||
|
||
CudaLapackSingleton::CudaLapackSingleton() { | ||
cusolverStatus_t stat = cusolverDnCreate(&handle); | ||
if (stat != CUSOLVER_STATUS_SUCCESS) | ||
Kokkos::abort("CUSOLVER initialization failed\n"); | ||
|
||
Kokkos::push_finalize_hook([&]() { cusolverDnDestroy(handle); }); | ||
} | ||
|
||
CudaLapackSingleton& CudaLapackSingleton::singleton() { | ||
static CudaLapackSingleton s; | ||
return s; | ||
} | ||
|
||
} // namespace Impl | ||
} // namespace KokkosLapack | ||
#endif // defined (KOKKOSKERNELS_ENABLE_TPL_CUSOLVER) | ||
|
||
#if defined(KOKKOSKERNELS_ENABLE_TPL_MAGMA) | ||
#include <KokkosLapack_tpl_spec.hpp> | ||
|
||
namespace KokkosLapack { | ||
namespace Impl { | ||
|
||
MagmaSingleton::MagmaSingleton() { | ||
magma_int_t stat = magma_init(); | ||
if (stat != MAGMA_SUCCESS) Kokkos::abort("MAGMA initialization failed\n"); | ||
|
||
Kokkos::push_finalize_hook([&]() { magma_finalize(); }); | ||
} | ||
|
||
MagmaSingleton& MagmaSingleton::singleton() { | ||
static MagmaSingleton s; | ||
return s; | ||
} | ||
|
||
} // namespace Impl | ||
} // namespace KokkosLapack | ||
#endif // defined(KOKKOSKERNELS_ENABLE_TPL_MAGMA) | ||
|
||
#endif // KOKKOSLAPACK_CUDA_TPL_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters