Commit Graph

624 Commits

Author SHA1 Message Date
Matthew Letter
6b9cb536a8 added new lines at the end of bot recommended files 2018-07-02 16:21:00 -06:00
Matthew Letter
3c9e7f049f updated Atomic array to use new excution object paradigm 2018-07-02 16:21:00 -06:00
Kenneth Moreland
71486f0864 Fix TestingPointLocatorUniformGrid for double precision
There was an error in TestingPointLocatorUniformGrid in which it was
creating arrays of type vtkm::Float32 and passing them to a worklet that
expected vtkm::FloatDefault. This is corrected.
2018-07-01 11:27:35 +02:00
ayenpure
e2dccee099 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into spatialsearch 2018-06-30 11:56:33 -06:00
Kenneth Moreland
6f75cd008b Fix crash in CUDA compiler
Previously when PointLocatorUniformGrid.h was compiled by the CUDA
compiler, the compiler would crash. Apparently during the ptxas
part of the compiler goes into a crazy recursion and runs out of
stack space. This appears to be a long-standing bug in CUDA
(been there for multiple releases) without a clear reason why it
sometimes rears its ugly head. (See for example
https://devtalk.nvidia.com/default/topic/1028825/cuda-programming-and-performance/-ptxas-died-with-status-0xc00000fd-stack_overflow-/)

The problem appears to be when having a doubly or triply nested
loop over a box of values to check in the uniform array. This
appears to fix the problem by converting that to a single for
loop with some index magic to convert that to 3D indices.
2018-06-27 23:52:48 +02:00
Kenneth Moreland
439beaaed9 Make point locator tests have consistent devices 2018-06-27 10:37:59 +02:00
Li-Ta Lo
9c2fdd5745 infinite loop at ptxas 2018-06-26 13:35:22 -06:00
Li-Ta Lo
8df78aedc7 TestingPointLocatorUniformGrid works for serial backend 2018-06-25 14:17:33 -06:00
Li-Ta Lo
c4921c0e7a fixed all most of compiler error, able to print something from point locator on execution side 2018-06-22 17:11:03 -06:00
Li-Ta Lo
1165845422 commit before mergin master 2018-06-22 14:18:55 -06:00
Li-Ta Lo
2e519f6508 Merge branch 'pointlocator' into pointlocator2 2018-06-19 12:06:54 -06:00
ayenpure
d8e8078099 Fixing the typos with ScanExclusiveByKey
- Fixed the typo
- Moved the test to vtkm/worklet/testing as vtkm/cont/testing does not execute with CUDA
2018-06-15 16:39:00 -07:00
luz.paz
940c891886 Misc. typos
Found via `codespell` and `grep`
more typos

includes source typo change and a typo that needs further review
follow-up typos


Follow-up typos


Revert a commit
2018-06-14 16:49:11 -04:00
ayenpure
671987148f Adding working implementation of BIH with test
- Uses smart pointers
  - need to get rid of them
2018-06-13 15:08:15 -07:00
Haocheng LIU
86f22bf47f Add a release resources API to CellSet and its derived classes 2018-06-12 11:44:18 -04:00
Kenneth Moreland
e62091a619 Add ability to "allocate" implicit storage
Previously, it was not possible to call Allocate or Shrink on an
implicit storage. The reason for this is that the implicit storage does
not represent any real memory and any attempt to modify it is wrong.

However, there are some rare cases where ArrayHandle will attempt to
"allocate" the storage even when behaving in a read-only manner. The use
case this is being created for is when an ArrayHandleImplicit first
calls ReleaseResources and then calls ReleaseResourcesExecution (or
anything else that tries to get a control-side portal). In this case,
the ReleaseResources makes the control side portal invalid and the
ReleaseResourcesExecution attempts to make it valid again by allocating
the storage to size 0. This change solves the problem by allowing the
implicit storage to be "allocated" to something smaller than originally
created.
2018-06-05 17:07:44 -05:00
Kenneth Moreland
9d16fadfc3 Merge topic 'vec-initializer-lists'
157894436 Enable Vec construction with intializer_list of single value
79afe2a16 Simplify make_ArrayHandleSwizzle
ae8d994d2 Add support for initializer lists in Vec

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1239
2018-06-05 12:26:21 -04:00
ayenpure
61fdfac710 Adding updated CellLocator / PointLocator APIs
- Adding API files
- Adding back Manish's BoundingIntervalHierarchy search structure
- Updating CMakeLists.txt to accomodate these changes
- Adding the old test file from Manish - won't build for now
2018-06-04 20:04:38 -07:00
ayenpure
18579394ed Moving Files for proper CellLocator/PointLocator APIs
-Changing the existing CellLocator.h to CellLocatorHelper.h,
 it's used by CellLocatorTwoLevelUniformGrid.h

-Changing unit tests and worklets that use CellLocator.h to use CellLocatorHelper.h
2018-06-04 19:51:54 -07:00
Allison Vacanti
d833d9285f Merge topic 'openmp'
183bcf109 Add initial version of an OpenMP backend.
7b5ad3e80 Expand device scheduler test to check for overlap.
e621b6ba3 Generalize the TBB radix sort implementation.
d60278434 Specialize swap for ArrayPortalValueReference types.
761f8986f Cache inputs to SSI::Unique benchmark.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1099
2018-05-31 16:49:15 -04:00
Kenneth Moreland
79afe2a169 Simplify make_ArrayHandleSwizzle
Create a form that allows you to enumerate the indices as arguments
rather than having to construct a Vec.
2018-05-30 17:07:06 -06:00
Haocheng LIU
7d226a4666 Add a common API for CoordinateSystem to unload execution resources
This commit also fixes a bug that ArrayTransfer of ArrayHandleVirtualCoordinate
does not release execution resources properly.
2018-05-30 17:25:54 -04:00
Shreeraj Jadhav
6e099b7c09 Fix issue #110 TestingDeviceAdapter uniform_int_distribution
This fix addresses issue #110. Test functions in TestingDeviceAdapter have
been updated to test large arrays through random indices using
std::uniform_int_distribution rather than testing every 100th or 50th value.
2018-05-30 11:04:02 -04:00
Allison Vacanti
7b5ad3e80c Expand device scheduler test to check for overlap.
Add a test that fails if DeviceAdapterAlgorithm::Schedule
executes the same instance twice. Useful for checking block
scheduling algorithms.
2018-05-29 14:49:44 -04:00
Allison Vacanti
93506d25e2 Change function signatures to use 'using' aliases.
Also cleaned up some lingering type typedefs.
2018-05-25 17:18:41 -04:00
Haocheng LIU
5c797169ec Use the strong typed enums for vtkm::cont::Field
Since Field association is used either when creating or working
with 'vtkm::cont::Field', it's put in the class itself.
2018-05-22 11:44:51 -04:00
Robert Maynard
9764aca5fe Merge topic 'vtkm_cont_device_tests_use_error_device_to_smoke_out_bad_device_uses'
1c5feeb1 Make sure all device specific tests use the intended device.
30205be8 Make sure PointLocatorUniformGrid always uses the provided device adapter
74df09fb Remove unneeded trailing ; from PointLocatorUniformGrid

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1209
2018-05-17 12:32:42 -04:00
David Thompson
1cf1ca7141 Merge topic 'cell-measure'
00c7905a Rename `vtkm::dot()` to `vtkm::Dot()`.
dd7c17f7 Compute cell measures (arc length, area, volume).

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1203
2018-05-17 11:02:34 -04:00
Brad King
b0baa951fa Merge topic '43-ArrayHandleCompositeVector-refactor'
c3c8d0fd Refactor ArrayHandleCompositeVector to simplify usage and impl.
ec88b7dd Markup array portals for use in the exec env.
3159b376 Make Swizzle and ExtractComponent array parameters runtime vars.
19344707 Add vtkm_taotuple to build system.
d23c4452 Merge branch 'upstream-taotuple' into tmp
b3b14de7 taotuple 2018-05-15 (e3de8c97)
b00f6c1c Add taocpp/tuple as a thirdparty package.

Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1199
2018-05-17 09:23:28 -04:00
David Thompson
00c7905afb Rename vtkm::dot() to vtkm::Dot().
This keeps the old name around but prepares it for removal
in the next release.
2018-05-17 08:51:01 -04:00
Allison Vacanti
c3c8d0fd70 Refactor ArrayHandleCompositeVector to simplify usage and impl.
- Use tao::tuple instead of FunctionInterface to hold array/portal
  collections.
- Type signatures are simplified. Now just use:
  - ArrayHandleCompositeVector<ArrayT1, ArrayT2, ...>
  - make_ArrayHandleCompositeVector(array1, array2, ...)
  instead of relying on helper structs to determine types.
- No longer support component selection from an input array. All
  input arrays must have the same ValueType (See ArrayHandleSwizzle
  and ArrayHandleExtractComponent as the replacements for these
  usecases.
2018-05-16 11:45:12 -04:00
Allison Vacanti
3159b376b3 Make Swizzle and ExtractComponent array parameters runtime vars. 2018-05-16 11:45:11 -04:00
Robert Maynard
1c5feeb185 Make sure all device specific tests use the intended device.
This means that we not only setup the runtime device tracker
to force the intended device, it also means making sure
the default device is the error device.
2018-05-16 08:21:16 -04:00
Robert Maynard
e28244f345 Re-implement DeviceAdapterRuntimeDetector to avoid ODR violations.
The previous implementation of DeviceAdapterRuntimeDetector caused
multiple differing definitions of the same class to exist and
was causing the runtime device tracker to report CUDA as disabled
when it actually was enabled.

The ODR was caused by having a default implementation for
DeviceAdapterRuntimeDetector and a specific specialization for
CUDA. If a library had both CUDA and C++ sources it would pick up
both implementations and would have undefined behavior. In general
it would think the CUDA backend was disabled.

To avoid this kind of situation in the future I have reworked VTK-m
so that each device adapter must implement DeviceAdapterRuntimeDetector
for that device.
2018-05-15 13:08:34 -04:00
Li-Ta Lo
89c30aefdd extract PrepareForExecution() as per Ken's feedback 2018-05-03 17:19:50 -06:00
Li-Ta Lo
c27528d884 Extract neareast neighbor search functionality into an ExecutionObject
Modify PointLocatorUniform::Build to return an ExecutionObjec, Locator.
The Locator can the be passed to Worklets for finding neareast neighbor
point by calling the FindNeareastPoint method.
2018-05-03 13:57:44 -06:00
Robert Maynard
dac7ab987a Correct a bad memcpy in ColorTable that gcc 7 found 2018-05-02 13:32:02 -04:00
Robert Maynard
c6726644b9 Reformat some test code to stop gcc 7.3 from segfaulting.
Somehow deducing the parameters to a static function was causing
gcc to segfault and crash. Changed around the code to use a free
function and everything works properly
2018-05-02 13:32:02 -04:00
Kenneth Moreland
edc4c85fd9 Move Scatter from Worklet to Dispatcher
Previously, when a Worklet needed a scatter, the scatter object was
stored in the Worklet object. That was problematic because that means
the Scatter, which is a control object, was shoved into the execution
environment.

To prevent that, move the Scatter into the Dispatcher object. The
worklet still declares a ScatterType alias, but no longer has a
GetScatter method. Instead, the Dispatcher now takes a Scatter object in
its constructor. If using the default scatter (ScatterIdentity), the
default constructor is used. If using another type of Scatter that
requires data to set up its state, then the caller of the worklet needs
to provide that to the dispatcher. For convenience, worklets are
encouraged to have a MakeScatter method to help construct a proper
scatter object.
2018-04-27 00:43:51 -04:00
Utkarsh Ayachit
3211c1501c add support to run test with MPI.
`vtkm_unit_tests` now supports an MPI option that can be used to add
test that run with MPI. Adding `UnitTestFieldRangeGlobalCompute` to test
global ranges for fields.
2018-04-10 14:48:37 -04:00
Robert Maynard
2ed1bb7271 Merge topic 'color_table_stop_leaking_memory'
86c487e6 Properly clean up ColorTable's memory.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Acked-by: James Kress <james@jameskress.com>
Merge-request: !1141
2018-04-09 08:18:56 -04:00
Utkarsh Ayachit
6938b05c33 Remove GetBounds methods from MultiBlock.
Removing GetBounds and related methods from MultiBlock. These have been
replaced by BoundsCompute and BoundsGlobalCompute.
2018-04-05 17:31:49 -04:00
Utkarsh Ayachit
f37e642563 Remove MultiBlock::GetGlobalRange API.
Removing MultiBlock::GetGlobalRange API to keep things consistent with
DataSet API. Instead, one should use `FieldRangeCompute` or
`FieldRangeGlobalCompute` as appropriate.
2018-04-05 17:16:10 -04:00
Utkarsh Ayachit
20a052f44e add FieldRangeCompute. 2018-04-05 17:16:10 -04:00
Robert Maynard
86c487e614 Properly clean up ColorTable's memory. 2018-04-05 14:43:51 -04:00
Robert Maynard
84311a2453 Merge branch 'master' into cmake_refactor 2018-04-05 10:18:36 -04:00
Robert Maynard
c123796949 VTK-m ArrayHandle can now take ownership of a user allocated memory location
Previously memory that was allocated outside of VTK-m was impossible to transfer to
VTK-m as we didn't know how to free it. By extending the ArrayHandle constructors
to support a Storage object that is being moved, we can clearly express that
the ArrayHandle now owns memory it didn't allocate.

Here is an example of how this is done:
```cpp
  T* buffer = new T[100];
  auto user_free_function = [](void* ptr) { delete[] static_cast<T*>(ptr); };

  vtkm::cont::internal::Storage<T, vtkm::cont::StorageTagBasic>
      storage(buffer, 100, user_free_function);
  vtkm::cont::ArrayHandle<T> arrayHandle(std::move(storage));
```
2018-04-04 11:28:25 -04:00
Robert Maynard
707970f492 VTK-m StorageBasic is now able to give/take ownership of user allocated memory.
This fixes the three following issues with StorageBasic.

1. Memory that was allocated by VTK-m and Stolen by the user needed the
proper free function called which is generally StorageBasicAllocator::deallocate.
But that was hard for the user to hold onto. So now we provide a function
pointer to the correct free function.

2. Memory that was allocated outside of VTK-m was impossible to transfer to
VTK-m as we didn't know how to free it. This is now resolved by allowing the
user to specify a free function to be called on release.

3. When the CUDA backend allocates memory for an ArrayHandle that has no
control representation, and the location we are running on supports concurrent
managed access we want to specify that cuda managed memory as also the host memory.
This requires that StorageBasic be able to call an arbitrary new delete function
which is chosen at runtime.
2018-04-04 11:27:57 -04:00
Robert Maynard
0d45c5cff2 Correct warnings found after disabling all warning when CUDA is enabled. 2018-04-04 11:00:12 -04:00
Kenneth Moreland
3a812b044e Make default ColorTable preset
Changed the "default" ColorTable preset from "cool to warm" to
"viridis." Also made a default constructor for ColorTable that sets it
to this default preset.

The main reason to change to viridis for the default is that it is in
LAB space. We are concerned that having the default ColorTable preset
being Diverging space could lead to users using that color space
inappropriately.
2018-04-02 15:32:23 -06:00