-
Notifications
You must be signed in to change notification settings - Fork 8
/
CommStruct.cc
40 lines (33 loc) · 1.1 KB
/
CommStruct.cc
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
// Copyright (c) 2020 HOOMD-TF Developers
#include "CommStruct.h"
namespace hoomd_tf
{
/*! \file CommStruct.cc
\brief CommStructDerived constructor definition
*/
template<>
CommStructDerived<Scalar4>::CommStructDerived(GlobalArray<Scalar4>& array, const char* name) :
CommStruct(2, sizeof(Scalar), name),
m_array(&array)
{
int tmp[] = {static_cast<int>(array.getNumElements()), 4};
setNumElements(tmp);
}
template<>
CommStructDerived<Scalar3>::CommStructDerived(GlobalArray<Scalar3>& array, const char* name) :
CommStruct(2, sizeof(Scalar), name),
m_array(&array)
{
int tmp[] = {static_cast<int>(array.getNumElements()), 3};
setNumElements(tmp);
}
//! Define template constructor for Scalar dtype
template<>
CommStructDerived<Scalar>::CommStructDerived(GlobalArray<Scalar>& array, const char* name) :
CommStruct(2, sizeof(Scalar), name),
m_array(&array)
{
int tmp[] = {static_cast<int>(array.getNumElements()), 1};
setNumElements(tmp);
}
}