added tensorframe prototype · code-in-cpp/taskflow@cd62b6f · GitHub
Skip to content

Commit cd62b6f

Browse files
committed
added tensorframe prototype
1 parent 75ec092 commit cd62b6f

10 files changed

Lines changed: 449 additions & 9 deletions

File tree

CMakeLists.txt

Lines changed: 16 additions & 1 deletion

doxygen/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "Taskflow"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 2.6.0
41+
PROJECT_NUMBER = 2.7.0 (master branch)
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

examples/tensorframe/add.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <taskflow/tensorframe.hpp>
2+
3+
int main(){
4+
5+
tf::Tensor<float> tensor({2, 3, 3, 4}, 10);
6+
7+
tensor.dump(std::cout);
8+
9+
std::cout << tensor.flat_chunk_index(1, 2, 2, 3) << '\n';
10+
std::cout << tensor.flat_index(1, 2, 2, 3) << '\n';
11+
std::cout << tensor.chunk_size() << '\n';
12+
13+
14+
return 0;
15+
}
16+

taskflow/algorithm/for_each.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Task FlowBuilder::for_each_guided(B&& beg, E&& end, C&& c, H&& chunk_size){
114114
q = chunk_size;
115115
}
116116
size_t e0 = (q <= r) ? s0 + q : N;
117-
if(next.compare_exchange_strong(s0, e0, std::memory_order_release,
117+
if(next.compare_exchange_strong(s0, e0, std::memory_order_relaxed,
118118
std::memory_order_relaxed)) {
119119
std::advance(beg, s0-z);
120120
for(size_t x = s0; x< e0; x++) {
@@ -212,7 +212,7 @@ Task FlowBuilder::for_each_index_guided(
212212
q = chunk_size;
213213
}
214214
size_t e0 = (q <= r) ? s0 + q : N;
215-
if(next.compare_exchange_strong(s0, e0, std::memory_order_release,
215+
if(next.compare_exchange_strong(s0, e0, std::memory_order_relaxed,
216216
std::memory_order_relaxed)) {
217217
auto s = static_cast<I>(s0) * inc + beg;
218218
for(size_t x=s0; x<e0; x++, s+= inc) {

taskflow/algorithm/reduce.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Task FlowBuilder::reduce_guided(
128128
q = C;
129129
}
130130
size_t e0 = (q <= r) ? s0 + q : N;
131-
if(next.compare_exchange_strong(s0, e0, std::memory_order_release,
131+
if(next.compare_exchange_strong(s0, e0, std::memory_order_relaxed,
132132
std::memory_order_relaxed)) {
133133
std::advance(beg, s0-z);
134134
for(size_t x = s0; x<e0; x++, beg++) {
@@ -549,7 +549,7 @@ Task FlowBuilder::transform_reduce_guided(
549549
q = C;
550550
}
551551
size_t e0 = (q <= r) ? s0 + q : N;
552-
if(next.compare_exchange_strong(s0, e0, std::memory_order_release,
552+
if(next.compare_exchange_strong(s0, e0, std::memory_order_relaxed,
553553
std::memory_order_relaxed)) {
554554
std::advance(beg, s0-z);
555555
for(size_t x = s0; x<e0; x++, beg++) {

taskflow/taskflow.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// TF_VERSION / 100 % 1000 is the minor version
99
// TF_VERSION / 100000 is the major version
1010

11-
// current version: 2.6.0
12-
#define TF_VERSION 200600
11+
// current version: 2.7.0
12+
#define TF_VERSION 200700
1313

1414
#define TF_MAJOR_VERSION TF_VERSION/100000
1515
#define TF_MINOR_VERSION TF_VERSION/100%1000
@@ -21,7 +21,7 @@ namespace tf {
2121
@brief queries the version information in string
2222
*/
2323
constexpr const char* version() {
24-
return "2.6.0";
24+
return "2.7.0";
2525
}
2626

2727

taskflow/tensorframe/tensor.hpp

Lines changed: 261 additions & 0 deletions

0 commit comments

Comments
 (0)