Skip to content

Commit 427bbbe

Browse files
authored
Merge pull request #41 from uonrobotics/refactor-naming-void-function
Refactor naming void function
2 parents b027ecf + 15841ec commit 427bbbe

File tree

138 files changed

+521
-476
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+521
-476
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
- Using **OpenMP**: Add the -fopenmp flag during compilation and link with the OpenMP library (-lgomp).
2626

2727
### Available Functions
28-
- **Array creation routines**: [empty](ctmd/empty.hpp), [empty_like](ctmd/empty_like.hpp), [eye](ctmd/eye.hpp), [ones](ctmd/ones.hpp), [ones_like](ctmd/ones_like.hpp), [zeros](ctmd/zeros.hpp), [zeros_like](ctmd/zeros_like.hpp), [full](ctmd/full.hpp), [full_like](ctmd/full_like.hpp), [copy](ctmd/copy.hpp), [arange](ctmd/arange.hpp), [linspace](ctmd/linspace.hpp).
29-
- **Array manipulation routines**: [reshape](ctmd/reshape.hpp), [expand_dims](ctmd/expand_dims.hpp), [concatenate](ctmd/concatenate.hpp).
30-
- **Linear algebra**: [matmul](ctmd/linalg/matmul.hpp), [matvec](ctmd/linalg/matvec.hpp), [vecmat](ctmd/linalg/vecmat.hpp), [norm](ctmd/linalg/norm.hpp), [inv](ctmd/linalg/inv.hpp).
31-
- **Logic functions**: [all](ctmd/all.hpp), [any](ctmd/any.hpp), [allclose](ctmd/allclose.hpp), [isclose](ctmd/isclose.hpp), [array_equal](ctmd/array_equal.hpp), [array_equiv](ctmd/array_equiv.hpp), [greater](ctmd/greater.hpp), [greater_equal](ctmd/greater_equal.hpp), [less](ctmd/less.hpp), [less_equal](ctmd/less_equal.hpp), [equal](ctmd/equal.hpp), [not_equal](ctmd/not_equal.hpp).
32-
- **Mathematical functions**: [sin](ctmd/sin.hpp), [cos](ctmd/cos.hpp), [tan](ctmd/tan.hpp), [atan2](ctmd/atan2.hpp), [deg2rad](ctmd/deg2rad.hpp), [rad2deg](ctmd/rad2deg.hpp), [sum](ctmd/sum.hpp), [add](ctmd/add.hpp), [negative](ctmd/negative.hpp), [multiply](ctmd/multiply.hpp), [divide](ctmd/divide.hpp), [subtract](ctmd/subtract.hpp), [maximum](ctmd/maximum.hpp), [minimum](ctmd/minimum.hpp), [clip](ctmd/clip.hpp), [sqrt](ctmd/sqrt.hpp), [absolute](ctmd/absolute.hpp).
33-
- **Random sampling**: [rand](ctmd/random/rand.hpp), [uniform](ctmd/random/uniform.hpp).
28+
- **Array creation routines**: [empty](ctmd/ctmd_empty.hpp), [empty_like](ctmd/ctmd_empty_like.hpp), [eye](ctmd/ctmd_eye.hpp), [ones](ctmd/ctmd_ones.hpp), [ones_like](ctmd/ctmd_ones_like.hpp), [zeros](ctmd/ctmd_zeros.hpp), [zeros_like](ctmd/ctmd_zeros_like.hpp), [full](ctmd/ctmd_full.hpp), [full_like](ctmd/ctmd_full_like.hpp), [copy](ctmd/ctmd_copy.hpp), [arange](ctmd/ctmd_arange.hpp), [linspace](ctmd/ctmd_linspace.hpp).
29+
- **Array manipulation routines**: [reshape](ctmd/ctmd_reshape.hpp), [expand_dims](ctmd/ctmd_expand_dims.hpp), [concatenate](ctmd/ctmd_concatenate.hpp).
30+
- **Linear algebra**: [matmul](ctmd/linalg/ctmd_linalg_matmul.hpp), [matvec](ctmd/linalg/ctmd_linalg_matvec.hpp), [vecmat](ctmd/linalg/ctmd_linalg_vecmat.hpp), [norm](ctmd/linalg/ctmd_linalg_norm.hpp), [inv](ctmd/linalg/ctmd_linalg_inv.hpp).
31+
- **Logic functions**: [all](ctmd/ctmd_all.hpp), [any](ctmd/ctmd_any.hpp), [allclose](ctmd/ctmd_allclose.hpp), [isclose](ctmd/ctmd_isclose.hpp), [array_equal](ctmd/ctmd_array_equal.hpp), [array_equiv](ctmd/ctmd_array_equiv.hpp), [greater](ctmd/ctmd_greater.hpp), [greater_equal](ctmd/ctmd_greater_equal.hpp), [less](ctmd/ctmd_less.hpp), [less_equal](ctmd/ctmd_less_equal.hpp), [equal](ctmd/ctmd_equal.hpp), [not_equal](ctmd/ctmd_not_equal.hpp).
32+
- **Mathematical functions**: [sin](ctmd/ctmd_sin.hpp), [cos](ctmd/ctmd_cos.hpp), [tan](ctmd/ctmd_tan.hpp), [atan2](ctmd/ctmd_atan2.hpp), [deg2rad](ctmd/ctmd_deg2rad.hpp), [rad2deg](ctmd/ctmd_rad2deg.hpp), [sum](ctmd/ctmd_sum.hpp), [add](ctmd/ctmd_add.hpp), [negative](ctmd/ctmd_negative.hpp), [multiply](ctmd/ctmd_multiply.hpp), [divide](ctmd/ctmd_divide.hpp), [subtract](ctmd/ctmd_subtract.hpp), [maximum](ctmd/ctmd_maximum.hpp), [minimum](ctmd/ctmd_minimum.hpp), [clip](ctmd/ctmd_clip.hpp), [sqrt](ctmd/ctmd_sqrt.hpp), [absolute](ctmd/ctmd_absolute.hpp).
33+
- **Random sampling**: [rand](ctmd/random/ctmd_random_rand.hpp), [uniform](ctmd/random/ctmd_random_uniform.hpp).
3434

3535
## Installation
3636
CTMD is a header-only library, so you can start using it by simply including [ctmd/ctmd.hpp](ctmd/ctmd.hpp) in your project.
@@ -88,7 +88,7 @@ bazel test tests/...
8888

8989
Benchmarks (in benchmarks/) are written using [GoogleBenchmark](https://github.com/google/benchmark). To run a benchmark (e.g., matrix addition in double precision):
9090
```bash
91-
bazel run benchmarks/add:pd
91+
bazel run benchmarks/add/none:ps
9292
```
9393

9494
## About

benchmarks/add/cpump/source.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

33
#include "benchmark/benchmark.h"
4-
#include "ctmd/add.hpp"
5-
#include "ctmd/full.hpp"
4+
#include "ctmd/ctmd_add.hpp"
5+
#include "ctmd/ctmd_full.hpp"
66

77
namespace md = ctmd;
88

@@ -18,7 +18,7 @@ template <typename T> inline void test(benchmark::State &state) noexcept {
1818
auto out = md::mdarray<T, md::dims<1>>{md::dims<1>{set_num}};
1919

2020
for (auto _ : state) {
21-
md::add(in1, in2, out, md::MPMode::CPUMP);
21+
md::add_to(in1, in2, out, md::MPMode::CPUMP);
2222
}
2323

2424
state.SetComplexityN(state.range(0));

benchmarks/add/gpump/source.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

33
#include "benchmark/benchmark.h"
4-
#include "ctmd/add.hpp"
5-
#include "ctmd/full.hpp"
4+
#include "ctmd/ctmd_add.hpp"
5+
#include "ctmd/ctmd_full.hpp"
66

77
namespace md = ctmd;
88

@@ -18,7 +18,7 @@ template <typename T> inline void test(benchmark::State &state) noexcept {
1818
auto out = md::mdarray<T, md::dims<1>>{md::dims<1>{set_num}};
1919

2020
for (auto _ : state) {
21-
md::add(in1, in2, out, md::MPMode::GPUMP);
21+
md::add_to(in1, in2, out, md::MPMode::GPUMP);
2222
}
2323

2424
state.SetComplexityN(state.range(0));

benchmarks/add/none/source.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

33
#include "benchmark/benchmark.h"
4-
#include "ctmd/add.hpp"
5-
#include "ctmd/full.hpp"
4+
#include "ctmd/ctmd_add.hpp"
5+
#include "ctmd/ctmd_full.hpp"
66

77
namespace md = ctmd;
88

@@ -18,7 +18,7 @@ template <typename T> inline void test(benchmark::State &state) noexcept {
1818
auto out = md::mdarray<T, md::dims<1>>{md::dims<1>{set_num}};
1919

2020
for (auto _ : state) {
21-
md::add(in1, in2, out);
21+
md::add_to(in1, in2, out);
2222
}
2323

2424
state.SetComplexityN(state.range(0));

benchmarks/all/none/source.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

33
#include "benchmark/benchmark.h"
4-
#include "ctmd/all.hpp"
5-
#include "ctmd/full.hpp"
4+
#include "ctmd/ctmd_all.hpp"
5+
#include "ctmd/ctmd_full.hpp"
66

77
namespace md = ctmd;
88

benchmarks/allclose/none/source.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

33
#include "benchmark/benchmark.h"
4-
#include "ctmd/allclose.hpp"
5-
#include "ctmd/full.hpp"
4+
#include "ctmd/ctmd_allclose.hpp"
5+
#include "ctmd/ctmd_full.hpp"
66

77
namespace md = ctmd;
88

benchmarks/array_equal/none/source.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

33
#include "benchmark/benchmark.h"
4-
#include "ctmd/array_equal.hpp"
5-
#include "ctmd/full.hpp"
4+
#include "ctmd/ctmd_array_equal.hpp"
5+
#include "ctmd/ctmd_full.hpp"
66

77
namespace md = ctmd;
88

benchmarks/atan2/none/source.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

33
#include "benchmark/benchmark.h"
4-
#include "ctmd/atan2.hpp"
5-
#include "ctmd/random/rand.hpp"
4+
#include "ctmd/ctmd_atan2.hpp"
5+
#include "ctmd/random/ctmd_random_rand.hpp"
66

77
namespace md = ctmd;
88

@@ -18,7 +18,7 @@ template <typename T> inline void test(benchmark::State &state) noexcept {
1818
auto out = md::mdarray<T, md::dims<1>>{md::dims<1>{set_num}};
1919

2020
for (auto _ : state) {
21-
md::atan2(in1, in2, out);
21+
md::atan2_to(in1, in2, out);
2222
}
2323

2424
state.SetComplexityN(state.range(0));

benchmarks/clip/none/source.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

33
#include "benchmark/benchmark.h"
4-
#include "ctmd/clip.hpp"
5-
#include "ctmd/full.hpp"
4+
#include "ctmd/ctmd_clip.hpp"
5+
#include "ctmd/ctmd_full.hpp"
66

77
namespace md = ctmd;
88

@@ -19,7 +19,7 @@ template <typename T> inline void test(benchmark::State &state) noexcept {
1919
auto out = md::mdarray<T, md::dims<1>>{md::dims<1>{set_num}};
2020

2121
for (auto _ : state) {
22-
md::clip(in, min, max, out);
22+
md::clip_to(in, min, max, out);
2323
}
2424

2525
state.SetComplexityN(state.range(0));

benchmarks/copy/none/source.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

33
#include "benchmark/benchmark.h"
4-
#include "ctmd/copy.hpp"
5-
#include "ctmd/full.hpp"
4+
#include "ctmd/ctmd_copy.hpp"
5+
#include "ctmd/ctmd_full.hpp"
66

77
namespace md = ctmd;
88

@@ -17,7 +17,7 @@ template <typename T> inline void test(benchmark::State &state) noexcept {
1717
auto out = md::mdarray<T, md::dims<1>>{md::dims<1>{set_num}};
1818

1919
for (auto _ : state) {
20-
md::copy(in, out);
20+
md::copy_to(in, out);
2121
}
2222

2323
state.SetComplexityN(state.range(0));

0 commit comments

Comments
 (0)