Skip to content

Commit

Permalink
worklet start. lassen down so can't build/test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolemarsaglia committed Sep 9, 2024
1 parent 6a693b8 commit 46290b9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 259 deletions.
1 change: 0 additions & 1 deletion src/libs/ascent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ if(VTKM_FOUND)
set(ascent_vtkh_dep_headers
runtimes/ascent_data_object.hpp
runtimes/ascent_vtkh_data_adapter.hpp
runtimes/ascent_vtkh_device_utils.hpp
runtimes/ascent_vtkh_collection.hpp
runtimes/flow_filters/ascent_runtime_vtkh_filters.hpp
runtimes/flow_filters/ascent_runtime_vtkh_utils.hpp
Expand Down
12 changes: 7 additions & 5 deletions src/libs/ascent/runtimes/ascent_vtkh_data_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
///
//-----------------------------------------------------------------------------
#include "ascent_vtkh_data_adapter.hpp"
#include "ascent_vtkh_device_utils.hpp"

// standard lib includes
#include <iostream>
Expand All @@ -33,8 +32,10 @@
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/Algorithm.h>
#include <vtkm/cont/ArrayCopy.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleExtractComponent.h>
#include <vtkm/cont/CoordinateSystem.h>
#include <vtkm/worklet/DispatcherMapField.h>
#include <vtkh/DataSet.hpp>

// other ascent includes
Expand Down Expand Up @@ -1674,14 +1675,15 @@ std::cerr << "AF 11" << std::endl;
Node n_tmp;
std::cerr << "AF 12" << std::endl;
n_tmp.set_external(DataType::float64(num_vals),ptr);
const uint64_t *input = n_vals.value();
double output2[num_vals];
const unsigned long long *input = n_vals.value();
vtkm::cont::ArrayHandle<unsigned long long> input_arr = vtkm::cont::make_ArrayHandle(vtkm_arr,input_arr);
std::cerr<< " before calling cast" <<std::endl;
castUint64ToFloat64(input, output2, num_vals);
vtkm::worklet::DispatcherMapField<vtkh::VTKMTypeCast>().Invoke(input_arr,vtkm_arr);
// VTKHDeviceAdapter::castUint64ToFloat64(input, output2, num_vals);
std::cerr<< " after calling cast" <<std::endl;

std::cerr << "AF 13" << std::endl;
n_vals.to_float64_array(n_tmp);
// n_vals.to_float64_array(n_tmp);

std::cerr << "AF 14" << std::endl;
// add field to dataset
Expand Down
68 changes: 0 additions & 68 deletions src/libs/ascent/runtimes/ascent_vtkh_device_utils.cpp

This file was deleted.

185 changes: 0 additions & 185 deletions src/libs/ascent/runtimes/ascent_vtkh_device_utils.hpp

This file was deleted.

14 changes: 14 additions & 0 deletions src/libs/vtkh/utils/vtkm_array_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,19 @@ GetVTKMPointer(vtkm::cont::ArrayHandle<T> &handle)
return handle.WritePortal().GetArray();
}

struct VTKmTypeCast : public vtkm::worklet::WorkletMapField
{
using ControlSignature = void(FieldIn input, FieldOut output);
using ExecutionSignature = void(_1, _2);

// Use VTKM_EXEC for the operator() function to make it run on both host and device
template<typename InType, typename OutType>
VTKM_EXEC void operator()(const InType& input, OutType& output) const
{
// Cast input to the output type and assign it
output = static_cast<OutType>(input);
}
};

}//namespace vtkh
#endif

0 comments on commit 46290b9

Please sign in to comment.