Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xpu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
xpu
Commits
5e2ed82c
Commit
5e2ed82c
authored
2 years ago
by
Felix Weiglhofer
Browse files
Options
Downloads
Patches
Plain Diff
Ensure sort / merge types have trivial constructor.
parent
f2ff66a1
No related branches found
Branches containing commit
Tags
v0.7.0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xpu/driver/hip_cuda/device.h
+9
-1
9 additions, 1 deletion
src/xpu/driver/hip_cuda/device.h
with
9 additions
and
1 deletion
src/xpu/driver/hip_cuda/device.h
+
9
−
1
View file @
5e2ed82c
...
@@ -10,11 +10,14 @@
...
@@ -10,11 +10,14 @@
#if XPU_IS_CUDA
#if XPU_IS_CUDA
#include
<cub/cub.cuh>
#include
<cub/cub.cuh>
#el
se //
XPU_IS_HIP
#el
if
XPU_IS_HIP
#include
<hipcub/hipcub.hpp>
#include
<hipcub/hipcub.hpp>
#else
#error "Internal XPU error: This should never happen."
#endif
#endif
#include
<iostream>
#include
<iostream>
#include
<type_traits>
#if 0
#if 0
#define PRINT_B(message, ...) if (xpu::thread_idx::x() == 0) printf("t 0: " message "\n", ##__VA_ARGS__)
#define PRINT_B(message, ...) if (xpu::thread_idx::x() == 0) printf("t 0: " message "\n", ##__VA_ARGS__)
...
@@ -345,7 +348,10 @@ public:
...
@@ -345,7 +348,10 @@ public:
using
block_merge_t
=
block_merge
<
data_t
,
BlockSize
,
ItemsPerThread
>
;
using
block_merge_t
=
block_merge
<
data_t
,
BlockSize
,
ItemsPerThread
>
;
//using storage_t = typename block_radix_sort::TempStorage;
//using storage_t = typename block_radix_sort::TempStorage;
static_assert
(
std
::
is_trivially_constructible_v
<
data_t
>
,
"Sorted type needs trivial constructor."
);
union
storage_t
{
union
storage_t
{
storage_t
()
=
default
;
tempStorage
sharedSortMem
;
tempStorage
sharedSortMem
;
#ifndef SEQ_MERGE
#ifndef SEQ_MERGE
typename
block_merge_t
::
storage_t
sharedMergeMem
;
typename
block_merge_t
::
storage_t
sharedMergeMem
;
...
@@ -486,6 +492,8 @@ class block_merge<Key, BlockSize, ItemsPerThread, XPU_COMPILATION_TARGET> {
...
@@ -486,6 +492,8 @@ class block_merge<Key, BlockSize, ItemsPerThread, XPU_COMPILATION_TARGET> {
public:
public:
using
data_t
=
Key
;
using
data_t
=
Key
;
static_assert
(
std
::
is_trivially_constructible_v
<
data_t
>
,
"Merged type needs trivial constructor."
);
struct
storage_t
{
struct
storage_t
{
data_t
sharedMergeMem
[
ItemsPerThread
*
BlockSize
+
1
];
data_t
sharedMergeMem
[
ItemsPerThread
*
BlockSize
+
1
];
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment