DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
deviceKernelsGeneric.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (c) 2017-2025 The Regents of the University of Michigan and DFT-FE
4// authors.
5//
6// This file is part of the DFT-FE code.
7//
8// The DFT-FE code is free software; you can use it, redistribute
9// it, and/or modify it under the terms of the GNU Lesser General
10// Public License as published by the Free Software Foundation; either
11// version 2.1 of the License, or (at your option) any later version.
12// The full text of the license can be found in the file LICENSE at
13// the top level of the DFT-FE distribution.
14//
15// ---------------------------------------------------------------------
16
17#if defined(DFTFE_WITH_DEVICE)
18# ifndef deviceKernelsGeneric_H_
19# define deviceKernelsGeneric_H_
20
21# include <dftfeDataTypes.h>
22# include <MemorySpaceType.h>
23# include <TypeConfig.h>
24# include <DeviceTypeConfig.h>
25
26namespace dftfe
27{
28 namespace utils
29 {
30 namespace deviceKernelsGeneric
31 {
32 void
33 setupDevice(const int &mpi_rank);
34
35 template <typename ValueTypeComplex, typename ValueTypeReal>
36 void
37 copyComplexArrToRealArrsDevice(const dftfe::size_type size,
38 const ValueTypeComplex *complexArr,
39 ValueTypeReal * realArr,
40 ValueTypeReal * imagArr);
41
42
43 template <typename ValueTypeComplex, typename ValueTypeReal>
44 void
45 copyRealArrsToComplexArrDevice(const dftfe::size_type size,
46 const ValueTypeReal * realArr,
47 const ValueTypeReal * imagArr,
48 ValueTypeComplex * complexArr);
49
50
51
52 template <typename ValueType>
53 void
54 sadd(ValueType * y,
55 ValueType * x,
56 const ValueType beta,
57 const dftfe::size_type size);
58
59
60 // This kernel interpolates the nodal data to quad data
61 // The function takes the cell level nodal data
62 // and interpolates it to the quad data in each cell
63 // by multiplying with the shape function
64 template <typename ValueType1, typename ValueType2>
65 void
66 interpolateNodalDataToQuadDevice(
67 const dftfe::size_type numDofsPerElem,
68 const dftfe::size_type numQuadPoints,
69 const dftfe::size_type numVecs,
70 const ValueType2 * parentShapeFunc,
71 const ValueType1 * mapPointToCellIndex,
72 const ValueType1 * mapPointToProcLocal,
73 const ValueType1 * mapPointToShapeFuncIndex,
74 const ValueType2 * parentNodalValues,
75 ValueType2 * quadValues);
76
77 } // namespace deviceKernelsGeneric
78 } // namespace utils
79} // namespace dftfe
80
81# endif
82#endif
Definition Cell.h:36
Definition pseudoPotentialToDftfeConverter.cc:34
unsigned int size_type
Definition TypeConfig.h:6