Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Todd Kordenbrock
VTK-m
Commits
1f6a662c
Commit
1f6a662c
authored
May 25, 2018
by
Allison Vacanti
Browse files
Merge DevAdaptAlgoThrust --> DevAdaptAlgoCuda.
parent
be0c6a17
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
vtkm/cont/cuda/internal/CMakeLists.txt
View file @
1f6a662c
...
...
@@ -22,7 +22,6 @@ set(headers
ArrayManagerExecutionCuda.h
CudaAllocator.h
DeviceAdapterAlgorithmCuda.h
DeviceAdapterAlgorithmThrust.h
DeviceAdapterAtomicArrayImplementationCuda.h
DeviceAdapterRuntimeDetectorCuda.h
DeviceAdapterTagCuda.h
...
...
@@ -49,7 +48,7 @@ endif()
target_sources
(
vtkm_cont PRIVATE
${
CMAKE_CURRENT_SOURCE_DIR
}
/ArrayManagerExecutionCuda.cu
${
CMAKE_CURRENT_SOURCE_DIR
}
/CudaAllocator.cu
${
CMAKE_CURRENT_SOURCE_DIR
}
/DeviceAdapterAlgorithm
Thrust
.cu
${
CMAKE_CURRENT_SOURCE_DIR
}
/DeviceAdapterAlgorithm
Cuda
.cu
${
CMAKE_CURRENT_SOURCE_DIR
}
/DeviceAdapterRuntimeDetectorCuda.cu
${
CMAKE_CURRENT_SOURCE_DIR
}
/DeviceAdapterTimerImplementationCuda.cu
${
CMAKE_CURRENT_SOURCE_DIR
}
/ExecutionArrayInterfaceBasicCuda.cu
...
...
vtkm/cont/cuda/internal/DeviceAdapterAlgorithm
Thrust
.cu
→
vtkm/cont/cuda/internal/DeviceAdapterAlgorithm
Cuda
.cu
View file @
1f6a662c
...
...
@@ -18,7 +18,7 @@
// this software.
//============================================================================
#include
<vtkm/cont/cuda/internal/DeviceAdapterAlgorithm
Thrust
.h>
#include
<vtkm/cont/cuda/internal/DeviceAdapterAlgorithm
Cuda
.h>
#include
<atomic>
#include
<mutex>
...
...
@@ -65,11 +65,12 @@ VTKM_CONT_EXPORT vtkm::UInt32 getNumSMs(int dId)
}
return
numSMs
[
index
];
}
}
}
// end namespace cuda::internal
// we use cuda pinned memory to reduce the amount of synchronization
// and mem copies between the host and device.
template
<
>
char
*
DeviceAdapterAlgorithmThrust
<
vtkm
::
cont
::
DeviceAdapterTagCuda
>::
GetPinnedErrorArray
(
char
*
DeviceAdapterAlgorithm
<
vtkm
::
cont
::
DeviceAdapterTagCuda
>::
GetPinnedErrorArray
(
vtkm
::
Id
&
arraySize
,
char
**
hostPointer
)
{
...
...
@@ -92,8 +93,7 @@ char* DeviceAdapterAlgorithmThrust<vtkm::cont::DeviceAdapterTagCuda>::GetPinnedE
return
devicePtr
;
}
template
<
>
char
*
DeviceAdapterAlgorithmThrust
<
vtkm
::
cont
::
DeviceAdapterTagCuda
>::
SetupErrorBuffer
(
char
*
DeviceAdapterAlgorithm
<
vtkm
::
cont
::
DeviceAdapterTagCuda
>::
SetupErrorBuffer
(
vtkm
::
exec
::
cuda
::
internal
::
TaskStrided
&
functor
)
{
//since the memory is pinned we can access it safely on the host
...
...
@@ -111,8 +111,7 @@ char* DeviceAdapterAlgorithmThrust<vtkm::cont::DeviceAdapterTagCuda>::SetupError
return
hostErrorPtr
;
}
template
<
>
void
DeviceAdapterAlgorithmThrust
<
vtkm
::
cont
::
DeviceAdapterTagCuda
>::
GetGridsAndBlocks
(
void
DeviceAdapterAlgorithm
<
vtkm
::
cont
::
DeviceAdapterTagCuda
>::
GetGridsAndBlocks
(
vtkm
::
UInt32
&
grids
,
vtkm
::
UInt32
&
blocks
,
vtkm
::
Id
size
)
...
...
@@ -120,19 +119,18 @@ void DeviceAdapterAlgorithmThrust<vtkm::cont::DeviceAdapterTagCuda>::GetGridsAnd
(
void
)
size
;
int
deviceId
;
VTKM_CUDA_CALL
(
cudaGetDevice
(
&
deviceId
));
//get deviceid from cuda
grids
=
32
*
getNumSMs
(
deviceId
);
grids
=
32
*
cuda
::
internal
::
getNumSMs
(
deviceId
);
blocks
=
128
;
}
template
<
>
void
DeviceAdapterAlgorithmThrust
<
vtkm
::
cont
::
DeviceAdapterTagCuda
>::
GetGridsAndBlocks
(
void
DeviceAdapterAlgorithm
<
vtkm
::
cont
::
DeviceAdapterTagCuda
>::
GetGridsAndBlocks
(
vtkm
::
UInt32
&
grids
,
dim3
&
blocks
,
const
dim3
&
size
)
{
int
deviceId
;
VTKM_CUDA_CALL
(
cudaGetDevice
(
&
deviceId
));
//get deviceid from cuda
grids
=
32
*
getNumSMs
(
deviceId
);
grids
=
32
*
cuda
::
internal
::
getNumSMs
(
deviceId
);
if
(
size
.
x
==
0
)
{
//grids that have no x dimension
...
...
@@ -154,6 +152,4 @@ void DeviceAdapterAlgorithmThrust<vtkm::cont::DeviceAdapterTagCuda>::GetGridsAnd
}
}
}
}
}
}
}
// end namespace vtkm::cont
vtkm/cont/cuda/internal/DeviceAdapterAlgorithmCuda.h
View file @
1f6a662c
This diff is collapsed.
Click to expand it.
vtkm/cont/cuda/internal/DeviceAdapterAlgorithmThrust.h
deleted
100644 → 0
View file @
be0c6a17
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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