Skip to content

Commit b267f72

Browse files
authored
define contiguous buffer (#207)
1 parent 7dcf2d1 commit b267f72

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

include/tensorwrapper/buffer/contiguous.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#pragma once
1818
#include <tensorwrapper/buffer/replicated.hpp>
1919
#include <tensorwrapper/detail_/integer_utilities.hpp>
20+
#include <tensorwrapper/types/floating_point.hpp>
2021

2122
namespace tensorwrapper::buffer {
2223

@@ -137,4 +138,10 @@ class Contiguous : public Replicated {
137138
virtual const_reference get_elem_(index_vector index) const = 0;
138139
};
139140

141+
#define DECLARE_CONTIG_BUFFER(TYPE) extern template class Contiguous<TYPE>
142+
143+
TW_APPLY_FLOATING_POINT_TYPES(DECLARE_CONTIG_BUFFER);
144+
145+
#undef DECLARE_CONTIG_BUFFER
146+
140147
} // namespace tensorwrapper::buffer
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2025 NWChemEx-Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
#include <tensorwrapper/buffer/contiguous.hpp>
17+
18+
namespace tensorwrapper::buffer {
19+
20+
#define DEFINE_CONTIG_BUFFER(TYPE) template class Contiguous<TYPE>
21+
22+
TW_APPLY_FLOATING_POINT_TYPES(DEFINE_CONTIG_BUFFER);
23+
24+
#undef DEFINE_CONTIG_BUFFER
25+
26+
} // namespace tensorwrapper::buffer

0 commit comments

Comments
 (0)