Commit Graph

283 Commits

Author SHA1 Message Date
Robert Maynard
4020f51988 RuntimeDeviceTracker can't be copied and is only accessible via reference.
As the RuntimeDeviceTracker is a per thread construct we now make
it explicit that you can only get a reference to the per-thread
version and can't copy it.
2019-05-20 11:43:05 -04:00
Robert Maynard
18a0cd35b0 vtkm::worklet::Invoker now supports scatter types
Fixes #297
2019-05-15 11:04:14 -04:00
Robert Maynard
674fe1fbf2 StealArray now returns the array and free function as a Pair.
This helps reduces bugs when the callers ask to steal arrays
without getting the free function, or ask for the free function
after stealing the array.
2019-05-01 09:42:57 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Robert Maynard
047b646517 VTK-m now provides better scheduling parameters controls
VTK-m now offers a more GPU aware set of defaults for kernel scheduling.
When VTK-m first launches a kernel we do system introspection and determine
what GPU's are on the machine and than match this information to a preset
table of values. The implementation is designed in a way that allows for
VTK-m to offer both specific presets for a given GPU ( V100 ) or for
an entire generation of cards ( Pascal ).

Currently VTK-m offers preset tables for the following GPU's:
- Tesla V100
- Tesla P100

If the hardware doesn't match a specific GPU card we than try to find the
nearest know hardware generation and use those defaults. Currently we offer
defaults for
- Older than Pascal Hardware
- Pascal Hardware
- Volta+ Hardware

Some users have workloads that don't align with the defaults provided by
VTK-m. When that is the cause, it is possible to override the defaults
by binding a custom function to `vtkm::cont::cuda::InitScheduleParameters`.
As shown below:

```cpp
  ScheduleParameters CustomScheduleValues(char const* name,
                                          int major,
                                          int minor,
                                          int multiProcessorCount,
                                          int maxThreadsPerMultiProcessor,
                                          int maxThreadsPerBlock)
  {

    ScheduleParameters params  {
        64 * multiProcessorCount,  //1d blocks
        64,                        //1d threads per block
        64 * multiProcessorCount,  //2d blocks
        { 8, 8, 1 },               //2d threads per block
        64 * multiProcessorCount,  //3d blocks
        { 4, 4, 4 } };             //3d threads per block
    return params;
  }
  vtkm::cont::cuda::InitScheduleParameters(&CustomScheduleValues);
```
2019-04-17 08:32:16 -04:00
Robert Maynard
a5dbe1ece3 Merge topic 'bitfields'
661fb64de AtomicInterfaceControl functions are marked with VTKM_SUPPRESS_EXEC_WARNINGS
0c70f9b9a Add BitFieldIn/Out/InOut worklet signature tags.
a66510e81 Add ArrayHandleBitField, a boolean-valued AH backed by a BitField.
56cc5c3d3 Add support for BitFields.
d01b97382 Allow VTKM_SUPPRESS_EXEC_WARNINGS to be used inside macros.
2f2ca9370 Add bit operations FindFirstSetBit and CountSetBits to Math.h.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1629
2019-04-11 12:32:03 -04:00
Allison Vacanti
a66510e819 Add ArrayHandleBitField, a boolean-valued AH backed by a BitField. 2019-04-11 08:27:17 -04:00
Allison Vacanti
56cc5c3d3a Add support for BitFields.
BitFields are:
- Stored in memory using a contiguous buffer of bits.
- Accessible via portals, a la ArrayHandle.
- Portals operate on individual bits or words.
- Operations may be atomic for safe use from concurrent kernels.

The new BitFieldToUnorderedSet device algorithm produces an ArrayHandle
containing the indices of all set bits, in no particular order.

The new AtomicInterface classes provide an abstraction into bitwise
atomic operations across control and execution environments and are used
to implement the BitPortals.
2019-04-11 08:27:17 -04:00
Robert Maynard
89ec4aae2f Reduction on CUDA handles different input and output types better
When reducing an input type that differs from the output type
you need to write a custom binary operator that also implements
how to do the unary transformation.
2019-04-10 14:44:44 -04:00
Sujin Philip
e408537608 Merge topic 'update-CellLocatorTwoLevelUniformGrid'
566e220ea Suppress dashboard warnings
f20d7e788 Document the changes that are part of this MR.
f78e763be Add CellLocatorGeneral
c6bead838 Rename CellLocatorTwoLevelUniformGrid to CellLocatorUniformBins
ee838b829 Stylistic changes to CellLocators to match VTK-m

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1615
2019-04-03 15:56:27 -04:00
Sujin Philip
f20d7e7884 Document the changes that are part of this MR. 2019-04-03 15:13:34 -04:00
Kenneth Moreland
4e34feecb4 Add ability to specialize worklet for device
This adds an ExecutionSignature tag named Device that passes the
DeviceAdapterTag as an argument to the worklet's operator(). This allows
worklets to specialize their code based on the device.
2019-04-01 10:01:54 -06:00
Robert Maynard
e787d52afc Merge branch 'optionparser-to-third-party' into 'master'
Wrap third party optionparser.h in vtkm/cont/internal/OptionParser.h

See merge request vtk/vtk-m!1593
2019-04-01 10:56:01 -04:00
Kenneth Moreland
7237c46898 Wrap third party optionparser.h in vtkm/cont/internal/OptionParser.h
Previously we just took the optionparser.h file and stuck it right in
our source code. That was problematic for a variety of reasons.

1. It incorrectly assigned our license to external code.
2. It made lots of unnecessary changes to the original source (like
reformatting).
3. It made it near impossible to track patches we make and updates to
the original software.

Instead, use the third-party system to track changes to optionparser.h
in a different repository and then pull that into ours.
2019-03-26 15:47:17 -06:00
Kenneth Moreland
b0303c96ed Allow Initialize to parse only some arguments
When a library requires reading some command line arguments through a
function like Initialize, it is typical that it will parse through
arguments it supports and then remove those arguments from argc and argv
so that the remaining arguments can be parsed by the calling program.
VTK-m's initialize did not do that, so add that functionality.
2019-03-26 12:04:18 -06:00
Robert Maynard
d1a957bf5c Merge topic 'refactor_runtime_device_tracker'
838cb4337 Redesign RuntimeDeviceTracker and RuntimeDeviceInformation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1600
2019-03-26 10:08:31 -04:00
Robert Maynard
838cb43375 Redesign RuntimeDeviceTracker and RuntimeDeviceInformation
The RuntimeDeviceTracker had grown organically to handle multiple
different roles inside VTK-m. Now that we have device tags
that can be passed around at runtime, large portions of
the RuntimeDeviceTracker API aren't needed.

Additionally the RuntimeDeviceTracker had a dependency on knowing
the names of each device, and this wasn't possible
as that information was part of its self. Now we have moved that
information into RuntimeDeviceInformation and have broken
the recursion.
2019-03-26 08:36:18 -04:00
Allison Vacanti
ad15ae1553 Merge topic 'Variant_As'
e1f5c4dd9 Modify VariantAH::AsVirtual to cast to new ValueType if needed.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1585
2019-03-25 16:39:39 -04:00
Allison Vacanti
e1f5c4dd9b Modify VariantAH::AsVirtual to cast to new ValueType if needed.
E.g:

```
    ArrayHandle<Float64> doubleArray;
    VariantArrayHandle varHandle{doubleArray};
    ArrayHandleVirtual<Float32> = varHandle.AsVirtual<Float32>();
```

If there is a loss in range and/or precision, a warning is logged. If
the ValueTypes are Vecs with mismatched widths, an ErrorBadType is thrown.
Internally, an ArrayHandleCast is used between the VariantArrayHandle's
stored array and the ArrayHandleVirtual.
2019-03-25 11:39:45 -04:00
Li-Ta Lo
9b479c8e12 finish the change log for connected component filters 2019-03-24 23:22:55 -06:00
Li-Ta Lo
84351eff6d Merge branch 'master' into connected_component 2019-03-24 10:13:32 -06:00
Robert Maynard
256e0c3c11 Merge topic 'rename_to_GetRuntimeDeviceTracker'
ae11e115a RuntimeDeviceTracker: Remove `Global` from names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1592
2019-03-24 08:17:02 -04:00
Robert Maynard
ae11e115a0 RuntimeDeviceTracker: Remove Global from names 2019-03-22 08:53:26 -07:00
Kenneth Moreland
0af017b038 Move virtual methods of other CellLocators to vtkm_cont
These changes caused some warnings in clang to show up based on virtual
methods in other cell locators. Hence, the rest of the cell locators
have also had some of their code moved to vtkm_cont.
2019-03-20 17:38:50 -06:00
Kenneth Moreland
e87864b0e3 Put CellLocatorBoundingIntervalHierarchy in vtkm_cont library
All of the methods in CellLocatorBoundingIntervalHierarchy were listed in
header files. This is sometimes problematic with virtual methods. Since
everything implemented in it can just be embedded in a library, move the
code into the vtkm_cont library.
2019-03-20 17:33:08 -06:00
Li-Ta Lo
cbd04b4bed minor change based on code review feedback 2019-03-20 11:58:22 -06:00
Kenneth Moreland
bfe06d6d18 Merge topic 'point-merge'
6aa99aec0 Add ability to remove degenerate cells in CleanGrid
5688375c9 Add point merge capabilities to CleanGrid filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Abhishek Yenpure <abhishek@uoregon.edu>
Merge-request: !1558
2019-03-07 20:33:36 -05:00
Robert Maynard
508a704d60 Document vtkm_filter 2019-03-05 15:52:14 -05:00
Kenneth Moreland
0b32831afd Make ArrayHandleVirtual conform with other ArrayHandle structure
Previously, ArrayHandleVirtual was defined as a specialization of
ArrayHandle with the virtual storage tag. This was because the storage
object was polymorphic and needed to be handled special. These changes
moved the existing storage definition to an internal class, and then
managed the pointer to that implementation class in a Storage object
that can be managed like any other storage object.

Also moved the implementation of StorageAny into the implementation of
the internal storage object.
2019-03-01 15:50:14 -07:00
Kenneth Moreland
5688375c99 Add point merge capabilities to CleanGrid filter 2019-02-26 12:44:33 -07:00
Kenneth Moreland
f010a6931f Merge topic 'mask-worklets'
191d6e558 Add Mask capabilities to worklets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1528
2019-02-25 18:23:59 -05:00
Haocheng LIU
634f523d92 Merge benchmark executables into a device dependent shared library
VTK-m has been updated to replace old per device benchmark executables with a device
dependent shared library so that it's able to accept a device adapter at runtime through
the "--device=" argument.
2019-02-25 12:26:47 -05:00
Kenneth Moreland
191d6e5580 Add Mask capabilities to worklets
Mask objects allow you to specify which output values should be
generated when a worklet is run. That is, the Mask allows you to skip
the invocation of a worklet for any number of outputs.
2019-02-25 08:58:39 -07:00
Kenneth Moreland
1ca55ac319 Add specialized operators for ArrayPortalValueReference
The ArrayPortalValueReference is supposed to behave just like the value
it encapsulates and does so by automatically converting to the base type
when necessary. However, when it is possible to convert that to
something else, it is possible to get errors about ambiguous overloads.
To avoid these, add specialized versions of the operators to specify
which ones should be used.

Also consolidated the CUDA version of an ArrayPortalValueReference to the
standard one. The two implementations were equivalent and we would like
changes to apply to both.
2019-02-20 13:33:55 -07:00
Robert Maynard
ad98d818ce VTK-m now doesn't clobber external DIY installations
Fixes #334
2019-02-05 13:05:14 -05:00
Robert Maynard
6b3f60ee86 Merge topic 'remove_check_build_test'
4b47a4d92 Remove VTKmCheckSourceInBuild
45c24109a Add changelog for VTKmCheckSourceInInstall

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1537
2019-02-05 12:58:35 -05:00
Haocheng LIU
0696ae135e Merge topic 'asynchronize-timer'
415252c66 Introduce asynchronous and device independent timer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Haocheng LIU <haocheng.liu@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1530
2019-02-05 12:02:59 -05:00
Haocheng LIU
415252c662 Introduce asynchronous and device independent timer
The timer class now is asynchronous and device independent. it's using an
similiar API as vtkOpenGLRenderTimer with Start(), Stop(), Reset(), Ready(),
and GetElapsedTime() function. For convenience and backward compability, Each
Start() function call will call Reset() internally and each GetElapsedTime()
function call will call Stop() function if it hasn't been called yet for keeping
backward compatibility purpose.

Bascially it can be used in two modes:

* Create a Timer without any device info. vtkm::cont::Timer time;

  * It would enable timers for all enabled devices on the machine. Users can get a
specific elapsed time by passing a device id into the GetElapsedtime function.
If no device is provided, it would pick the maximum of all timer results - the
logic behind this decision is that if cuda is disabled, openmp, serial and tbb
roughly give the same results; if cuda is enabled it's safe to return the
maximum elapsed time since users are more interested in the device execution
time rather than the kernal launch time. The Ready function can be handy here
to query the status of the timer.

* Create a Timer with a device id. vtkm::cont::Timer time((vtkm::cont::DeviceAdapterTagCuda()));

  * It works as the old timer that times for a specific device id.
2019-02-05 12:01:56 -05:00
Robert Maynard
d0a70946b8 Simplify the DeviceAdapterRuntimeDetectorCuda to not do a kernel launch.
The kernel launch component of the runtime device adapter is fairly
pointless. If the hardware supports CUDA we should expect that
VTK-m has the correct kernel versions.

Plus in the original version if the CUDA device was being used
and the kernel launch returns cudaErrorDevicesUnavailable it
was never possible to restore CUDA support. Now what happens
is that the runtime tracker is marked as failed, but the
calling code can always go back and trying the device again.
2019-02-04 13:27:20 -05:00
Robert Maynard
45c24109af Add changelog for VTKmCheckSourceInInstall 2019-02-04 12:09:25 -05:00
Kenneth Moreland
d59ce11c00 Allow VariantArrayHandle CastAndCall to cast to concrete types
When you call VariantArrayHandle::CastAndCall, it now tries both basic
storage and virtual storage. You can modify the types of storages tried
by giving a type list of storage tags as the first argument.
2019-01-16 22:31:55 -06:00
Haocheng LIU
2f20549b4b Merge rendering testing executables to a shared library
This commit allows rendering testing executables to select the device at runtime.
2019-01-14 14:20:00 -05:00
Kenneth Moreland
821925fbf3 Update changedoc 2019-01-11 12:23:19 -07:00
Kenneth Moreland
b2e20bf90e Fix issues from removing field type templates
The script fixed up most of the issues. However, there were some
instances that the script was not able to pick up on. There were
also some instances that still needed a means to select types.
2019-01-11 12:23:19 -07:00
Kenneth Moreland
16c2dfd8be Add script to update control signature tags
Removes template parameters from tags that no longer use them.
2019-01-11 12:15:16 -07:00
Kenneth Moreland
42f810f70e Remove type lists from ControlSignature arguments for arrays
The typelist arguments for ControlSignature tags are antiquated. Remove
them.
2019-01-11 12:15:16 -07:00
Robert Maynard
f1e1a524e9 Require CMake 3.8 to build VTK-m. 2019-01-09 16:01:22 -05:00
Robert Maynard
ce95b8f788 VTK-m now supports case-insensitive construction of devices from strings.
Previously you had to exactly match the case of a device adapter's name to
construct it, which was a source of lots of problems ( OpenMP versus OPENMP, CUDA or Cuda ).

Now `vtkm::cont::make_DeviceAdapterId` and `vtkm::cont::RuntimeDeviceTracker` support
case-insensitive device construction.
2019-01-07 08:12:25 -05:00
Robert Maynard
718caaaeac CudaAllocator allows managed memory to be explicitly disabled 2018-12-28 11:30:29 -05:00
Robert Maynard
19c623bfa3 Add changelogs for ArrayHandleVirtual and VariantArrayHandle 2018-12-27 15:42:03 -05:00
Robert Maynard
4fcb2cb8d9 Improve the documentation on having a single worklet executable 2018-12-24 15:52:53 -05:00
Allison Vacanti
cdb1f5680a Add vtkm::cont::Initialize.
Also
- Renamed vtkm::cont::make_DeviceAdapterIdFromName to just overload
  make_DeviceAdapterId.
- Refactored CMake logic for unit tests
  - Since we're now querying the device tracker for the names, they
    cannot be all caps.
- Updated usages of InitLogging to use Initialize instead.
- Added changelog.
2018-12-13 10:15:44 -05:00
Haocheng LIU
e88e3ec39c Merge topic 'Merge-worklet-testing-executables'
885963667 Merge worklet testing executables into a device dependent shared library
88bcd0696 Bump Mean C++ Option Parser

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1432
2018-11-26 13:37:45 -05:00
Robert Maynard
5712719538 Add release notes for v1.3.0 2018-11-26 11:11:10 -05:00
Haocheng LIU
8859636672 Merge worklet testing executables into a device dependent shared library
VTK-m has been updated to replace old per device worklet testing executables with a device
dependent shared library so that it's able to accept a device adapter
at runtime.
Meanwhile, it updates the testing infrastructure APIs. vtkm::cont::testing::Run
function would call ForceDevice when needed and if users need the device
adapter info at runtime, RunOnDevice function would pass the adapter into the functor.

Optional Parser is bumped from 1.3 to 1.7.
2018-11-23 10:13:56 -05:00
Haocheng LIU
bb06717803 Make RuntimeDeviceInformation class template independent
By making RuntimeDeviceInformation class template independent, vtkm is
able to detect
device info at runtime with a runtime specified deviceId. In the past
it's impossible
because the CRTP pattern does not allow function overloading(compiler
would complain
that DeviceAdapterRuntimeDetector does not have Exists() function
defined).
2018-11-01 14:55:33 -04:00
Kenneth Moreland
3b847f9aca Add change log for removal of TryExecute from filters 2018-10-17 16:53:15 -06:00
Haocheng LIU
246a58309c Add a split sharp edge worklet and filter
It's a filter that Split sharp manifold edges where the feature angle
between the adjacent surfaces are larger than the threshold value.
When an edge is split, it would add a new point to the coordinates
and update the connectivity of an adjacent surface.
Ex. there are two adjacent triangles(0,1,2) and (2,1,3). Edge (1,2) needs
to be split. Two new points 4(duplication of point 1) an 5(duplication of point 2)
would be added and the later triangle's connectivity would be changed
to (5,4,3).
By default, all old point's fields would be copied to the new point.
Use with caution.
2018-10-09 15:33:47 -04:00
Kenneth Moreland
6543942568 Merge topic 'better-test-macros'
899b93ec2 Allow variable arguments to VTKM_TEST_ASSERT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1429
2018-10-08 12:11:13 -04:00
Kenneth Moreland
899b93ec2c Allow variable arguments to VTKM_TEST_ASSERT
The VTKM_TEST_ASSERT macro is a very useful tool for performing checks
in tests. However, it is rather annoying to have to always specify a
message for the assert. Often the failure is self evident from the
condition (which is already printed out), and specifying a message is
both repetative and annoying.

Also, it is often equally annoying to print out additional information
in the case of an assertion failure. In that case, you have to either
attach a debugger or add a printf, see the problem, and remove the
printf.

This change solves both of these problems. VTKM_TEST_ASSERT now takes a
condition and a variable number of message arguments. If no message
arguments are given, then a default message (along with the condition)
are output. If multiple message arguments are given, they are appended
together in the result. The messages do not have to be strings. Any
object that can be sent to a stream will be printed correctly. This
allows you to print out the values that caused the issue.
2018-10-08 09:17:56 -06:00
luz.paz
d5beb69ec1 Misc. typos
Found via `codespell`
2018-10-04 10:30:33 -04:00
Allison Vacanti
bd337854ec Initial implementation of general logging.
Addresses #291.
2018-10-02 11:37:55 -04:00
Kenneth Moreland
2b05487398 Add ExecutionAndControlObjectBase
This is a subclass of ExecutionObject and a superset of its
functionality. In addition to having a PrepareForExecution method, it
also has a PrepareForControl method that gets an object appropriate for
the control environment. This is helpful for situations where you need
code to work in both environments, such as the functor in an
ArrayHandleTransform.

Also added several runtime checks for execution objects and execution
and cotnrol objects.
2018-09-08 11:54:28 -06:00
Kenneth Moreland
98a0a20feb Allow ArrayHandleTransform to work with ExecObject
This change allows you to set a subclass of
vtkm::cont::ExecutionObjectBase as a functor
used in ArrayHandleTransform. This latter class will then detect that
the functor is an ExecObject and will call PrepareForExecution with the
appropriate device to get the actual Functor object.

This change allows you to use virtual objects and other device dependent
objects as functors for ArrayHandleTransform without knowing a priori
what device the portal will be used on.
2018-09-05 13:11:04 -06:00
Kenneth Moreland
d879188de0 Make DispatcherBase invoke using a TryExecute
Rather than force all dispatchers to be templated on a device adapter,
instead use a TryExecute internally within the invoke to select a device
adapter.

Because this removes the need to declare a device when invoking a
worklet, this commit also removes the need to declare a device in
several other areas of the code.
2018-08-29 19:18:54 -07:00
Kenneth Moreland
926f81d9c0 Add change log for ArrayHandleView 2018-08-29 14:25:52 -07:00
Allison Vacanti
0f3f23627b Move changelog to proper directory. 2018-08-28 14:57:01 -07:00
Robert Maynard
18fdc009a3 Merge topic 'upgrade_algorithms_to_support_runtime_device'
59c8bd28a vtkm::cont::Algorithm now can be told which device to run on at runtime

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1365
2018-08-28 13:34:55 -04:00
Allison Vacanti
669ccb9130 Refactor CellSetExplicit to store connectivity in a shared_ptr.
This addresses issue #268 by ensuring that the CellToPoint validity
flag survives FunctionInterface's value copies.
2018-08-23 11:13:13 -04:00
Robert Maynard
c9b2a843b5 Merge topic 'document_more_of_vtkm_style'
084b4d760 Document some of the VTK-m coding style such as single line loops

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1366
2018-08-20 16:49:01 -04:00
Haocheng LIU
d4b12d0b49 Merge topic 'update-vec-initializer-list-with-constexpr'
f9f011944 Update vec-initializer-lists changelog to cover constexpr change

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1363
2018-08-20 13:25:08 -04:00
Haocheng LIU
7d22132253 Merge topic 'allow-disabling/enabling-cuda-managed-memory'
e34301eca Allow disabling/enabling of CUDA managed memory via an env variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1359
2018-08-17 13:14:02 -04:00
Haocheng LIU
e34301eca8 Allow disabling/enabling of CUDA managed memory via an env variable
By setting the environment variable "VTKM_MANAGEDMEMO_DISABLED" to be 1,
users are able to disable CUDA managed memory even though the hardware is
capable of doing so.
2018-08-17 11:10:15 -04:00
Sujin Philip
16250d29b8 Add changelog for cuda deferred free functionality 2018-08-17 10:22:57 -04:00
Robert Maynard
59c8bd28aa vtkm::cont::Algorithm now can be told which device to run on at runtime 2018-08-16 16:08:34 -04:00
Robert Maynard
084b4d760e Document some of the VTK-m coding style such as single line loops
The auto code formatting doesn't capture the entire VTK-m style
and developers should know the style before they open a merge request
and get a billion warnings.
2018-08-15 13:39:47 -04:00
Haocheng LIU
f9f0119447 Update vec-initializer-lists changelog to cover constexpr change
The changelog is updated to replace initializer list changes with
variadic constructors and constexpr changes.

On OSX and Linux:
| Type |Constructed with| Compile time  | Run Time
|-----|---|---|---|
|scalar(1~4)    | ()  | Yes  |   |
|scalar(1~4)    | {}  | Yes  |   |
|scalar(>4)    | () | Yes |  |
|scalar(>4)    |  {} |  |  Yes |
|nested type(1~4)     |  () |  Yes |   |
|nested type(1~4)     |  {} |  Yes |   |
|nested type(>4)     | ()  | ERROR  |  ERROR|
|nested type(>4)     |  {} |   | Yes |
Only on windows with a compiler older than Visual Studio 2017
version 15.0 is vec with size>4 constructed at compile time.
2018-08-15 09:30:35 -04:00
Sudhanshu Sane
3364d1c4e0 Lagrangian filter, example
The added files provide support for Lagrangian analysis of velocity fields of time-varying data. Examples show how to use the filter to generate data and a second example demonstrates consuming generated information to calculate new particle trajectories.
2018-08-13 14:53:41 -07:00
Robert Maynard
c4fa66aff4 Merge topic 'better_runtime_device_representation'
554bc3d36 At runtime TryExecute supports a specific deviceId to execute on.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1334
2018-08-08 12:41:32 -04:00
Robert Maynard
554bc3d369 At runtime TryExecute supports a specific deviceId to execute on.
Instead of always using the first enabled device, now TryExecute
can be told which device at runtime to use.
2018-08-07 17:22:18 -04:00
Haocheng LIU
ce9cd8072a Use std::call_once to construct singeltons
By using `call_once` from C++11, we can simplify the logic in code
where we are querying same value variables from multiple threads.
2018-08-06 16:36:03 -04:00
Haocheng LIU
1fcbca3eed Replace std::random_shuffle with std::shuffle
std::random_shuffle is deprecated in C++14 because it's using std::rand
which uses a non uniform distribution and the underlying algorithm is
unspecified. Using std::shuffle can provide a reliable result in a 64
bit version.
2018-08-02 12:15:58 -04:00
Haocheng LIU
c95db1fc78 Use thread_local in GetGlobalRuntimeDeviceTracker if possible
It will reduce the cost of getting the thread runtime device tracker,
and will have a better runtime overhead if user constructs a lot of
short lived threads that use VTK-m.
2018-08-01 15:51:24 -04:00
Sujin Philip
259d670ab5 Merge topic 'cuda-per-thread-streams-2'
06dee259f Minimize cuda synchronizations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1288
2018-07-25 15:07:39 -04:00
Matthew Letter
79b28ead47 Update change-execution-object-creation.md 2018-07-24 13:58:00 -04:00
Matthew Letter
51cd5da84b Update change-execution-object-creation.md 2018-07-19 16:28:13 -04:00
Matthew Letter
47f317943a Add new file change-execution-object-creation.md 2018-07-19 16:26:52 -04:00
David Thompson
a92905a545 Merge topic 'oscillator-squashed'
4192b9a1d Add a point-oscillator filter + example

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1311
2018-07-18 09:34:26 -04:00
Sebastien Jourdain
4192b9a1d8 Add a point-oscillator filter + example
The oscillator is a simple analytical source of time-varying data.
It provides a function value at each point that is computed as a
sum of Gaussian kernels -- each with a specified position, amplitude,
frequency, and phase.
2018-07-18 09:33:06 -04:00
Allison Vacanti
3089609b98 Merge topic 'wavelet_source'
0d6834476 Add WaveletGenerator worklet.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1310
2018-07-16 11:27:30 -04:00
Allison Vacanti
0d68344769 Add WaveletGenerator worklet. 2018-07-13 14:20:49 -04:00
Robert Maynard
288719045c Merge topic 'colortable_properly_support_explicit_device_execution'
6dc06423d ColorTable can provide vtkm::exec::Colortable to a specific device

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1316
2018-07-12 11:06:07 -04:00
Robert Maynard
6dc06423d8 ColorTable can provide vtkm::exec::Colortable to a specific device
Previously it wasn't possible to get a color table transfered
to a specific device.
2018-07-12 10:28:18 -04:00
Haocheng LIU
69aafb1d46 Merge topic 'Create-warp-by-scale-workletAndFilter'
56993bc9e Add a warpScalar worklet and filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1276
2018-07-11 14:50:32 -04:00
Kenneth Moreland
abfc946f84 Merge topic 'exec-objects-as-alg-sort-compare'
f14021dd8 Shorten code for PrepareArgForExec
3b828608a Support ExecArg behavior in vtkm::cont::Algorithm methods

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1308
2018-07-10 19:01:40 -04:00
Haocheng LIU
56993bc9e2 Add a warpScalar worklet and filter
This commit adds a worklet as well as a filter that modify point coordinates by moving points
along point normals by the scalar amount times the scalar factor.
It's a simpified version of the vtkWarpScalar class in VTK. Additionally the filter doesn't
modify the point coordinates, but creates a new point coordinates that have been warped.
2018-07-09 15:33:25 -04:00
Haocheng LIU
a4c4c1931c Add a warpVector worklet and filter
This commit adds a worklet as well as a filter that modify point coordinates by moving points
along a vector by a certain scalar amount.
It's a simpified version of the vtkWarpVector in VTK.
It doesn't modify the point coordinates, but creates a new point coordinates that have been warped.
2018-07-09 14:22:12 -04:00
Robert Maynard
64958b014b VTK-m now supports passing pointers when invoking worklets.
The original design of invoke and the transport infrastructure
relied on the implementation behavior of vtkm::cont types
such as ArrayHandle that used an internal shared_ptr to managed
state. This allowed passing by value instead of passing by
non-const ref when needing to transfer information to the device.

As VTK-m adds support for classes that use virtuals the ability
to pass by base pointer type allows for us to invoke worklets
using a base type without the risk of type slicing.

Additional by moving over to a non-const ref Invocation we
can update all transports that have 'output' to now be
by ref and therefore support types that can't be copied while
being 'more' correct.
2018-07-06 14:27:36 -04:00
Kenneth Moreland
3b828608a4 Support ExecArg behavior in vtkm::cont::Algorithm methods
Most of the arguments given to device adapter algorithms are actually
control-side arguments that get converted to execution objects internally
(usually a `vtkm::cont::ArrayHandle`). However, some of the algorithms,
take an argument that is passed directly to the execution environment, such
as the predicate argument of `Sort`. If the argument is a plain-old-data
(POD) type, which is common enough, then you can just pass the object
straight through. However, if the object has any special elements that have
to be transferred to the execution environment, such as internal arrays,
passing this to the `vtkm::cont::Algorithm` functions becomes
problematic.

To cover this use case, all the `vtkm::cont::Algorithm` functions now
support automatically transferring objects that support the `ExecObject`
worklet convention. If any argument to any of the `vtkm::cont::Algorithm`
functions inherits from `vtkm::cont::ExecutionObjectBase`, then the
`PrepareForExecution` method is called with the device the algorithm is
running on, which allows these device-specific objects to be used without
the hassle of creating a `TryExecute`.
2018-07-06 18:57:54 +02:00
Sujin Philip
06dee259f7 Minimize cuda synchronizations
1. Have a per-thread pinned array for cuda errors
2. Check for errors before scheduling new tasks and at explicit sync points
3. Remove explicit synchronizations from most places

Addresses part 2 of #168
2018-07-03 14:19:06 -04:00
ayenpure
e319dcd6a1 Adding change log for cell and point locator APIs.
Done towards resolution of https://gitlab.kitware.com/vtk/vtk-m/issues/254
2018-07-03 08:50:05 -06:00
Haocheng LIU
c3e7de617e Add a changelog for cellset's unloading execution resources ability 2018-07-02 15:59:38 -04:00
David Thompson
d8cf1f7b51 Merge topic 'geometry-squashed'
880d8a989 Add `vtkm/Geometry.h` and test it.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1262
2018-06-20 14:15:50 -04:00
David Thompson
880d8a989e Add vtkm/Geometry.h and test it.
This commit adds several geometric constructs to vtk-m
in the `vtkm/Geometry.h` header. They may be used from
both the execution and control environments.

We also add methods to perform projection and Gram-Schmidt
orthonormalization to `vtkm/VectorAnalysis.h`.

See `docs/changelog/geometry.md` included in this commit
for more information.
2018-06-20 11:58:14 -04: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
Haocheng LIU
5393745ecd Allow histogram filter to take custom types
By passing TypeList and StorageList into FieldRangeGlobalCompute,
upstream users(VTK) can pass custom types into the histogram filter.
2018-06-11 17:10:24 -04:00
mclarsen
ced5640ca1 updating changelog and readme to reflect openmp 4.0 2018-06-07 08:23:15 -07: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
Kenneth Moreland
1578944360 Enable Vec construction with intializer_list of single value
Previously, the initilaizer_list of Vec had to be the exact
same number of values as the size of the Vec. Now, we also
accept a single value that is duplicated for all values in
the Vec. That allows you to more easily construct lists
of lists with repeated values.
2018-06-04 21:08:26 -05:00
Allison Vacanti
ec0791e941 Add a swap implementation that works on all backend.
Calling std::swap isn't legal from CUDA code, but the new vtkm::Swap
method is safe. It currently does a naive swap when compiling CUDA
code, and falls back to an ADL swap
2018-06-01 14:13:46 -04: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
Allison Vacanti
183bcf109a Add initial version of an OpenMP backend. 2018-05-31 16:47:48 -04:00
Kenneth Moreland
ae8d994d21 Add support for initializer lists in Vec
Add constructors to the `vtkm::Vec` classes that accept
`std::initializer_list`. The main advantage of this addition is that it
makes it much easier to initialize `Vec`s of arbitrary length.
2018-05-30 16:49:40 -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
Kenneth Moreland
e9a9ec3411 One of the changelog files was placed in the wrong directory 2018-05-30 07:39:50 -06:00
Kenneth Moreland
6fb6bd702e Add changelog file for changes moving scatter to dispatcher 2018-05-25 14:17:11 -06:00
Robert Maynard
543952e039 add a changelog entry for new cmake design 2018-05-24 10:28:18 -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
Haocheng LIU
fae8409c9c Add float version operations for vtkm::Math Pi()
This commit also removes the old static_cast<vtkm::float32>vtkm::Pi() usages and
fix serveral conversion warnings.
2018-05-21 10:58:15 -04:00
Robert Maynard
9f4f87c35b Merge topic 'document_more_vtkm_changes_since_1.2.0'
245d27bd Add changelog documents for major changes I made to VTK-m since 1.2

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1219
2018-05-19 08:30:23 -04:00
Allison Vacanti
00a9225ce1 Add changelog messages for fancy arrayhandle changes. 2018-05-18 17:39:49 -04:00
Robert Maynard
245d27bd5c Add changelog documents for major changes I made to VTK-m since 1.2 2018-05-18 17:36:22 -04:00
Sujin Philip
d5676214ba Add Changelog for previous commits 2018-05-18 15:24:44 -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
David Thompson
dd7c17f776 Compute cell measures (arc length, area, volume).
This commit adds a worklet and a filter to compute
signed integral measures of cells.

It also begins the practic of adding a markdown
changelog entry in `doc/changelog`. See the
changelog entry for details.
2018-05-17 08:50:56 -04:00
Robert Maynard
ee69c7a4b7 Remove VS2013 workarounds from VTK-m. 2018-02-23 15:39:39 -05:00
Kenneth Moreland
0e3b06d301 Update coding conventions
Reformat to look correct in 100 column display.

Update the copyright.

Remove and update some outdated specifications.

Remove description of formatting guidelines. There are done
automatically now.
2017-10-26 10:37:08 -06:00
Kenneth Moreland
fdaccc22db Remove exports for header-only functions/methods
Change the VTKM_CONT_EXPORT to VTKM_CONT. (Likewise for EXEC and
EXEC_CONT.) Remove the inline from these macros so that they can be
applied to everything, including implementations in a library.

Because inline is not declared in these modifies, you have to add the
keyword to functions and methods where the implementation is not inlined
in the class.
2016-11-15 22:22:13 -07:00
Robert Maynard
77121d1871 Add support to VTK-m to build with C++11 2016-08-03 15:38:38 -04:00
Robert Maynard
6b8e7822be The Copyright statement now has all the periods in the correct location. 2015-05-21 10:30:11 -04:00
Robert Maynard
8bd99b3871 Cleanup the documentation for VTK-m 2015-04-28 09:53:50 -04:00
Robert Maynard
2b7a0e0490 revise the header guard naming convention to not conflict with macro names. 2014-03-07 10:22:36 -05:00
Robert Maynard
c00d01be6f Move documents into a directory, instead being in the repos root. 2014-02-10 14:01:22 -05:00