Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VTK-m
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sudhanshu Sane
VTK-m
Commits
5251091e
Commit
5251091e
authored
Jan 02, 2019
by
Haocheng LIU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove compile time adapter checks in UnitTestBoundingIntervalHierarchy
parent
169f5516
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
18 deletions
+27
-18
vtkm/worklet/spatialstructure/KdTree3DNNSearch.h
vtkm/worklet/spatialstructure/KdTree3DNNSearch.h
+1
-1
vtkm/worklet/testing/CMakeLists.txt
vtkm/worklet/testing/CMakeLists.txt
+1
-1
vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx
vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx
+25
-16
No files found.
vtkm/worklet/spatialstructure/KdTree3DNNSearch.h
View file @
5251091e
...
...
@@ -214,7 +214,7 @@ public:
//set up stack size for cuda environment
#ifdef VTKM_CUDA
std
::
size_t
stackSizeBackup
;
std
::
size_t
stackSizeBackup
(
0
)
;
(
void
)
stackSizeBackup
;
if
(
id
.
GetValue
()
==
VTKM_DEVICE_ADAPTER_CUDA
)
{
...
...
vtkm/worklet/testing/CMakeLists.txt
View file @
5251091e
...
...
@@ -20,7 +20,7 @@
set
(
unit_tests
UnitTestAverageByKey.cxx
#
UnitTestBoundingIntervalHierarchy.cxx
UnitTestBoundingIntervalHierarchy.cxx
UnitTestCellAverage.cxx
UnitTestCellDeepCopy.cxx
UnitTestCellGradient.cxx
...
...
vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx
View file @
5251091e
...
...
@@ -23,6 +23,7 @@
#include <vtkm/cont/BoundingIntervalHierarchy.hxx>
#include <vtkm/cont/DataSetBuilderUniform.h>
#include <vtkm/cont/Timer.h>
#include <vtkm/cont/internal/DeviceAdapterTag.h>
#include <vtkm/cont/testing/Testing.h>
#include <vtkm/io/reader/VTKDataSetReader.h>
...
...
@@ -67,7 +68,9 @@ vtkm::cont::DataSet ConstructDataSet(vtkm::Id size)
return
vtkm
::
cont
::
DataSetBuilderUniform
().
Create
(
vtkm
::
Id3
(
size
,
size
,
size
));
}
void
TestBoundingIntervalHierarchy
(
vtkm
::
cont
::
DataSet
dataSet
,
vtkm
::
IdComponent
numPlanes
)
void
TestBoundingIntervalHierarchy
(
vtkm
::
cont
::
DataSet
dataSet
,
vtkm
::
IdComponent
numPlanes
,
const
vtkm
::
cont
::
DeviceAdapterId
&
id
)
{
using
DeviceAdapter
=
VTKM_DEFAULT_DEVICE_ADAPTER_TAG
;
using
Timer
=
vtkm
::
cont
::
Timer
<
DeviceAdapter
>
;
...
...
@@ -93,21 +96,27 @@ void TestBoundingIntervalHierarchy(vtkm::cont::DataSet dataSet, vtkm::IdComponen
Timer
interpolationTimer
;
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
IdComponent
>
results
;
#if
VTKM_DEVICE_ADAPTER == VTKM_DEVICE_ADAPTER
_CUDA
#if
def VTKM
_CUDA
//set up stack size for cuda envinroment
size_t
stackSizeBackup
;
cudaDeviceGetLimit
(
&
stackSizeBackup
,
cudaLimitStackSize
);
std
::
cout
<<
"Default stack size "
<<
stackSizeBackup
<<
"
\n
"
;
cudaDeviceSetLimit
(
cudaLimitStackSize
,
1024
*
50
);
size_t
stackSizeBackup
(
0
);
(
void
)
stackSizeBackup
;
if
(
id
.
GetValue
()
==
VTKM_DEVICE_ADAPTER_CUDA
)
{
cudaDeviceGetLimit
(
&
stackSizeBackup
,
cudaLimitStackSize
);
cudaDeviceSetLimit
(
cudaLimitStackSize
,
1024
*
50
);
}
#else
(
void
)
id
;
#endif
vtkm
::
worklet
::
DispatcherMapField
<
BoundingIntervalHierarchyTester
>
().
Invoke
(
centroids
,
bih
,
expectedCellIds
,
results
);
#if VTKM_DEVICE_ADAPTER == VTKM_DEVICE_ADAPTER_CUDA
cudaDeviceSetLimit
(
cudaLimitStackSize
,
stackSizeBackup
);
#ifdef VTKM_CUDA
if
(
id
.
GetValue
()
==
VTKM_DEVICE_ADAPTER_CUDA
)
{
cudaDeviceSetLimit
(
cudaLimitStackSize
,
stackSizeBackup
);
}
#endif
vtkm
::
Id
numDiffs
=
vtkm
::
cont
::
Algorithm
::
Reduce
(
results
,
0
,
vtkm
::
Add
());
vtkm
::
Float64
timeDiff
=
interpolationTimer
.
GetElapsedTime
();
...
...
@@ -119,17 +128,17 @@ void TestBoundingIntervalHierarchy(vtkm::cont::DataSet dataSet, vtkm::IdComponen
VTKM_TEST_ASSERT
(
numDiffs
==
0
,
"Calculated cell Ids not the same as expected cell Ids"
);
}
void
RunTest
()
void
RunTest
(
const
vtkm
::
cont
::
DeviceAdapterId
&
id
)
{
TestBoundingIntervalHierarchy
(
ConstructDataSet
(
16
),
3
);
TestBoundingIntervalHierarchy
(
ConstructDataSet
(
16
),
4
);
TestBoundingIntervalHierarchy
(
ConstructDataSet
(
16
),
6
);
TestBoundingIntervalHierarchy
(
ConstructDataSet
(
16
),
9
);
TestBoundingIntervalHierarchy
(
ConstructDataSet
(
16
),
3
,
id
);
TestBoundingIntervalHierarchy
(
ConstructDataSet
(
16
),
4
,
id
);
TestBoundingIntervalHierarchy
(
ConstructDataSet
(
16
),
6
,
id
);
TestBoundingIntervalHierarchy
(
ConstructDataSet
(
16
),
9
,
id
);
}
}
// anonymous namespace
int
UnitTestBoundingIntervalHierarchy
(
int
argc
,
char
*
argv
[])
{
return
vtkm
::
cont
::
testing
::
Testing
::
Run
(
RunTest
,
argc
,
argv
);
return
vtkm
::
cont
::
testing
::
Testing
::
Run
OnDevice
(
RunTest
,
argc
,
argv
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment