Skip to content

misc mixups for Frontier #470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/TiledArray/conversions/vector_of_arrays.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef TILEDARRAY_CONVERSIONS_VECTOR_OF_ARRAYS_H_
#define TILEDARRAY_CONVERSIONS_VECTOR_OF_ARRAYS_H_

#include <TiledArray/dist_array.h>

namespace TiledArray {

namespace detail {
Expand Down
3 changes: 2 additions & 1 deletion src/TiledArray/device/device_task_fn.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ struct deviceTaskFn : public TaskInterface {
} else {
// TODO should we use device callback or device events??
// insert device callback
TiledArray::device::launchHostFunc(*stream_, device_callback, task_);
DeviceSafeCall(TiledArray::device::launchHostFunc(
*stream_, device_callback, task_));
// processed sync, clear state
stream_ = {};
}
Expand Down
9 changes: 9 additions & 0 deletions src/TiledArray/device/thrust.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
#include <cuda_runtime_api.h>
#endif

// rocthrust headers rely on THRUST_DEVICE_SYSTEM being defined, which is only
// defined by the HIP-specific compilers to be usable with host compiler define
// it here explicitly
#ifdef TILEDARRAY_HAS_HIP
#ifndef THRUST_DEVICE_SYSTEM
#define THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_HIP
#endif
#endif

#include <thrust/device_vector.h>
#include <thrust/host_vector.h>

Expand Down
14 changes: 13 additions & 1 deletion src/TiledArray/tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,23 @@ class Tile {

// Dimension information accessors -----------------------------------------

/// Size accessors
/// Size accessor

/// \return The number of elements in the tensor
decltype(auto) size() const { return tensor().size(); }

/// Total size accessor

/// \return The number of elements in the tensor, tallied across batches (if
/// any)
decltype(auto) total_size() const {
if constexpr (detail::has_member_function_total_size_anyreturn_v<
tensor_type>) {
return tensor().total_size();
} else
return size();
}

/// Range accessor

/// \return An object describes the upper and lower bounds of the tensor data
Expand Down
2 changes: 2 additions & 0 deletions src/TiledArray/type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ GENERATE_HAS_MEMBER_TYPE(mapped_type)

GENERATE_HAS_MEMBER_FUNCTION_ANYRETURN(size)
GENERATE_HAS_MEMBER_FUNCTION(size)
GENERATE_HAS_MEMBER_FUNCTION_ANYRETURN(total_size)
GENERATE_HAS_MEMBER_FUNCTION(total_size)
GENERATE_HAS_MEMBER_FUNCTION_ANYRETURN(data)
GENERATE_HAS_MEMBER_FUNCTION(data)
GENERATE_HAS_MEMBER_FUNCTION_ANYRETURN(empty)
Expand Down
14 changes: 11 additions & 3 deletions tests/conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@
*
*/

#include "range_fixture.h"
#include "tiledarray.h"
#include "unit_test_config.h"

#include "TiledArray/conversions/concat.h"
#include "TiledArray/conversions/vector_of_arrays.h"

#include "TiledArray/conversions/concat.h"

#include "TiledArray/conversions/dense_to_sparse.h"
#include "TiledArray/conversions/make_array.h"
#include "TiledArray/conversions/sparse_to_dense.h"
#include "TiledArray/conversions/to_new_tile_type.h"

#include "TiledArray/expressions/tsr_expr.h"

#include "range_fixture.h"

using namespace TiledArray;

struct ConversionsFixture : public TiledRangeFixture {
Expand Down