Skip to content

Commit

Permalink
Cleanup of includes directory. (#246)
Browse files Browse the repository at this point in the history
Now breaking includes into directories.

Co-authored-by: jluitjens <jluitjens@nvidia.com>
  • Loading branch information
luitjens and luitjens authored Aug 15, 2022
1 parent 1281272 commit 0c5c8df
Show file tree
Hide file tree
Showing 121 changed files with 2,069 additions and 1,449 deletions.
1 change: 0 additions & 1 deletion bench/00_transform/einsum.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <nvbench/nvbench.cuh>
#include "matx.h"
#include "matx_einsum.h"

#if ENABLE_CUTENSOR

Expand Down
4 changes: 1 addition & 3 deletions examples/convolution.cu
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/////////////////////////////////////////////////////////////////////////////////

#include "matx_type_utils.h"
#include "matx_tensor.h"
#include "matx_conv.h"
#include "matx.h"
#include <cassert>
#include <cstdio>

Expand Down
1 change: 0 additions & 1 deletion examples/fft_conv.cu
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
/////////////////////////////////////////////////////////////////////////////////

#include "matx.h"
#include "matx_filter.h"
#include <cassert>
#include <cstdio>
#include <cuda/std/ccomplex>
Expand Down
1 change: 0 additions & 1 deletion examples/recursive_filter.cu
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
/////////////////////////////////////////////////////////////////////////////////

#include "matx.h"
#include "matx_filter.h"
#include <cassert>
#include <cstdio>
#include <cuda/std/ccomplex>
Expand Down
7 changes: 3 additions & 4 deletions examples/spectrogram.cu
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/////////////////////////////////////////////////////////////////////////////////

#include "matx.h"
#include "matx_viz.h"
#include "matx_make.h"
#include <cassert>
#include <cstdio>
#include <math.h>
#include <memory>

#include "matx.h"

using namespace matx;
#define FFT_TYPE CUFFT_C2C

Expand Down Expand Up @@ -156,4 +155,4 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
cudaStreamDestroy(stream);
CUDA_CHECK_LAST_ERROR();
MATX_EXIT_HANDLER();
}
}
3 changes: 1 addition & 2 deletions examples/spectrogram_graph.cu
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
/////////////////////////////////////////////////////////////////////////////////

#include "matx.h"
#include "matx_viz.h"
#include <cassert>
#include <cstdio>
#include <math.h>
Expand Down Expand Up @@ -165,4 +164,4 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
cudaStreamDestroy(stream);
CUDA_CHECK_LAST_ERROR();
MATX_EXIT_HANDLER();
}
}
29 changes: 10 additions & 19 deletions include/matx.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,19 @@

#pragma once
#include <cuda/std/ccomplex>
#include "matx_defines.h"
#include "matx_half_complex.h"
#include "matx_half.h"
#include "matx/core/defines.h"
#include "matx/core/error.h"
#include "matx/core/file_io.h"
#include "matx/core/half_complex.h"
#include "matx/core/half.h"
#include "matx/core/pybind.h"
#include "matx/core/tensor.h"
#include "matx/core/utils.h"

#include "matx_utils.h"
#include "matx_error.h"
#include "matx_tensor.h"
#include "matx_random.h"
#include "matx_tensor_generators.h"
#include "matx/executors/executors.h"
#include "matx/generators/generators.h"
#include "matx/operators/operators.h"
#include "matx/transforms/transforms.h"
#include "matx_exec_kernel.h"
#include "matx_fft.h"
#include "matx_conv.h"
#include "matx_corr.h"
#include "matx_matmul.h"
#include "matx_reduce.h"
#include "matx_inverse.h"
#include "matx_solver.h"
#include "matx_cov.h"
#include "matx_cub.h"


using fcomplex = cuda::std::complex<float>;
using dcomplex = cuda::std::complex<double>;
Expand Down
2 changes: 1 addition & 1 deletion include/matx_allocator.h → include/matx/core/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <cuda_runtime_api.h>
#endif

#include "matx_error.h"
#include "matx/core/error.h"

#pragma once

Expand Down
3 changes: 2 additions & 1 deletion include/matx_cache.h → include/matx/core/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@

#pragma once

#include "matx_error.h"
#include <functional>
#include <optional>
#include <unordered_map>

#include "matx/core/error.h"

namespace matx {
namespace detail {

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion include/matx_error.h → include/matx/core/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <exception>
#include <sstream>

#include "matx_stacktrace.h"
#include "matx/core/stacktrace.h"

namespace matx
{
Expand Down
8 changes: 4 additions & 4 deletions include/matx_file_io.h → include/matx/core/file_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/////////////////////////////////////////////////////////////////////////////////

#include "matx_pybind.h"
#include "matx_tensor.h"
#include <cstdio>
#include <iterator>
#include <shared_mutex>
Expand All @@ -41,7 +39,9 @@
// #include <cudf/io/csv.hpp>
// #include <cudf/types.hpp>

#include "matx_error.h"
#include "matx/core/pybind.h"
#include "matx/core/tensor.h"
#include "matx/core/error.h"

#pragma once

Expand Down Expand Up @@ -231,4 +231,4 @@ void WriteMAT(const TensorType &t, const std::string fname,
}

}; // namespace io
}; // namespace matx
}; // namespace matx
File renamed without changes.
9 changes: 5 additions & 4 deletions include/matx_half.h → include/matx/core/half.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@

#pragma once

#include "cuda_bf16.h"
#include "cuda_fp16.h"
#include <cuda/std/cmath>
#include "matx_defines.h"
#include <type_traits>

#include "cuda_bf16.h"
#include "cuda_fp16.h"
#include "matx/core/defines.h"

namespace matx {

/**
Expand Down Expand Up @@ -1209,4 +1210,4 @@ __MATX_HOST__ __MATX_DEVICE__ __MATX_INLINE__ matxHalf<T> tanh(const matxHalf<T>
using matxFp16 = matxHalf<__half>; ///< Alias for fp16
using matxBf16 = matxHalf<__nv_bfloat16>; ///< Alias for bf16

}; // namespace matx
}; // namespace matx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@
#pragma once
// Next line is a workaround for libcuda++ 11.6.0 on CTK 11.4.100+. Remove once libcuda++ is fixed
#define _LIBCUDACXX_HAS_NO_INT128
#include "cuComplex.h"
#include "matx_half.h"
#include <complex>
#include <cuda/std/complex>
#include <cuda/std/cmath>
#include <type_traits>

#include "cuComplex.h"
#include "matx/core/half.h"

namespace matx {

/**
Expand Down Expand Up @@ -1043,4 +1044,4 @@ tanh(const matxHalfComplex<T> &x)
using matxFp16Complex = matxHalfComplex<matxFp16>; ///< Alias for a MatX fp16 complex wrapper
using matxBf16Complex = matxHalfComplex<matxBf16>; ///< Alias for a MatXbf16 complex wrapper

}; // namespace matx
}; // namespace matx
8 changes: 4 additions & 4 deletions include/matx_make.h → include/matx/core/make_tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once

#include "matx_storage.h"
#include "matx_tensor_desc.h"
#include "matx_shape.h"
#include "matx/core/storage.h"
#include "matx/core/tensor_desc.h"
#include "matx/core/shape.h"

namespace matx {

Expand Down Expand Up @@ -353,4 +353,4 @@ auto make_static_tensor() {
return tensor_t<T, desc.Rank(), decltype(s), decltype(desc)>{std::move(s), std::move(desc)};
}

} // namespace matx
} // namespace matx
2 changes: 1 addition & 1 deletion include/matx_pybind.h → include/matx/core/pybind.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once

#include "matx.h"
#include "matx/core/type_utils.h"


#include <pybind11/embed.h>
Expand Down
6 changes: 3 additions & 3 deletions include/matx_shape.h → include/matx/core/shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
#include <iomanip>
#include <type_traits>

#include "matx_allocator.h"
#include "matx_error.h"
#include "matx_type_utils.h"
#include "matx/core/allocator.h"
#include "matx/core/error.h"
#include "matx/core/type_utils.h"

namespace matx {

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions include/matx_storage.h → include/matx/core/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

#pragma once

#include "matx_type_utils.h"
#include "matx_allocator.h"
#include "matx_error.h"
#include "matx/core/type_utils.h"
#include "matx/core/allocator.h"
#include "matx/core/error.h"

namespace matx
{
Expand Down Expand Up @@ -538,4 +538,4 @@ namespace matx
*/
template <typename T>
using DefaultStorage = basic_storage<raw_pointer_buffer<T, owning, matx_allocator<T>>>;
};
};
12 changes: 6 additions & 6 deletions include/matx_tensor.h → include/matx/core/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
#include <memory>
#include <type_traits>

#include "matx_allocator.h"
#include "matx_error.h"
#include "matx_storage.h"
#include "matx_tensor_impl.h"
#include "matx_utility_kernels.cuh"
#include "matx_tensor_utils.h"
#include "matx/core/allocator.h"
#include "matx/core/error.h"
#include "matx/core/storage.h"
#include "matx/core/tensor_impl.h"
#include "matx/core/tensor_utils.h"
#include "matx/kernels/utility.cuh"

static constexpr int MAX_TENSOR_DIM = 4;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#include <array>
#include <type_traits>
#include "matx_error.h"
#include "matx/core/error.h"

namespace matx {

Expand Down Expand Up @@ -445,4 +445,4 @@ template <int RANK>
using DefaultDescriptor = tensor_desc_cr_ds_64_64_t<RANK>;


}; // namespace matx
}; // namespace matx
18 changes: 9 additions & 9 deletions include/matx_tensor_impl.h → include/matx/core/tensor_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@

#include <type_traits>
#include <cuda/std/functional>
#include "matx_error.h"
#include "matx_set.h"
#include "matx_defines.h"
#include "matx_tensor_desc.h"
#include "matx_type_utils.h"
#include "matx_tensor_utils.h"
#include "matx_exec_kernel.h"
#include "matx_executor.h"
#include "matx_make.h"
#include "matx/core/error.h"
#include "matx/core/defines.h"
#include "matx/core/tensor_desc.h"
#include "matx/core/type_utils.h"
#include "matx/core/tensor_utils.h"
#include "matx/operators/set.h"
//#include "matx_exec_kernel.h"
//#include "matx_executor.h"
#include "matx/core/make_tensor.h"

namespace matx {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@

#include <cuda/std/tuple>
#include <functional>
#include "matx_make.h"

#include "matx/core/make_tensor.h"

namespace matx
{
Expand Down Expand Up @@ -618,4 +619,4 @@ void Print(const Op &op, Args... dims) {
// }, tup);
// }

}
}
7 changes: 4 additions & 3 deletions include/matx_type_utils.h → include/matx/core/type_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@

#pragma once

#include "cuda_fp16.h"
#include "matx_half.h"
#include "matx_half_complex.h"
#include <any>
#include <memory>
#include <complex>
Expand All @@ -43,6 +40,10 @@
#include <cuda/std/tuple>
#include <type_traits>

#include "cuda_fp16.h"
#include "matx/core/half.h"
#include "matx/core/half_complex.h"

/**
* Defines type traits for host and device compilers. This file should be includable by
* the host compiler, so no device code should be present
Expand Down
4 changes: 2 additions & 2 deletions include/matx_utils.h → include/matx/core/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
/////////////////////////////////////////////////////////////////////////////////

#pragma once
#include "matx_defines.h"
#include "matx_error.h"
#include "matx/core/defines.h"
#include "matx/core/error.h"

#define AMPERE_CC 8
#define VOLTA_CC 7
Expand Down
Loading

0 comments on commit 0c5c8df

Please sign in to comment.