Skip to content

Commit

Permalink
Fix compatiblity with KMM 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnh committed Dec 9, 2024
1 parent 353e3f2 commit 6a89cf2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set(CXXFLAGS
$<$<COMPILE_LANGUAGE:CUDA>:-forward-unknown-to-host-compiler>
$<$<COMPILE_LANGUAGE:CUDA>:--generate-line-info>
-Wall -Wextra -Wconversion -Wno-unused-parameter
$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=-Werror>
#$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=-Werror>
$<$<COMPILE_LANGUAGE:CUDA>:--use_fast_math>
$<$<COMPILE_LANGUAGE:CUDA>:-Xptxas="-v">
)
Expand Down
4 changes: 2 additions & 2 deletions include/compas/core/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ struct CompasContext {

template<typename T, size_t N>
Array<std::decay_t<T>, N> allocate(host_view<T, N> content) const {
return m_runtime.allocate(content.data(), kmm::Dim<N>(content.sizes()));
return m_runtime.allocate(content.data(), kmm::Size<N>(content.sizes()));
}

template<typename T, typename... Sizes>
Array<std::decay_t<T>, sizeof...(Sizes)> allocate(const T* content_ptr, Sizes... sizes) const {
kmm::Dim<sizeof...(Sizes)> sizes_array = {kmm::checked_cast<index_t>(sizes)...};
kmm::Size<sizeof...(Sizes)> sizes_array = {kmm::checked_cast<index_t>(sizes)...};
return m_runtime.allocate(content_ptr, sizes_array);
}

Expand Down
2 changes: 1 addition & 1 deletion include/compas/core/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace compas {

using index_t = kmm::default_index_type;
using index_t = int;

template<typename T, size_t N = 1>
using view = kmm::view<T, N>;
Expand Down
3 changes: 2 additions & 1 deletion julia-bindings/src/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ auto catch_exceptions(F fun) -> decltype(fun()) {

template<typename T, typename... Ns>
compas::host_view_mut<T, sizeof...(Ns)> make_view(T* ptr, Ns... sizes) {
return {ptr, {{kmm::checked_cast<kmm::default_stride_type>(sizes)...}}};
using index_type = typename compas::host_view_mut<T, sizeof...(Ns)>::index_type;
return {ptr, {{kmm::checked_cast<index_type>(sizes)...}}};
}

extern "C" const char* compas_version() {
Expand Down

0 comments on commit 6a89cf2

Please sign in to comment.