incorrect migration of __shfl_xor_sync CUDA API within a template function
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia con il reproducer di template CUDA fornito ed eseguilo tramite dpct. Confronta la migrazione del riferimento KeyT basato su template con quella del riferimento esplicito int, concentrandoti sul riconoscimento di __shfl_xor_sync e sulla conseguente chiamata dpct::permute_sub_group_by_xor. Il lavoro è completato quando il caso basato su template viene migrato in modo coerente con il caso di tipo esplicito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
When I tried to migrate a template function with just 1 loc in the function body.
#include <cuda_runtime.h>
template <typename KeyT, typename ValueT, uint32_t WORKGROUP_SIZE>
class WarpSort{
__device__ static void swap(KeyT& key, ValueT& value,
uint32_t const& step, uint32_t const& activemask,
bool bDescending, std::true_type const& isKeyOnly)
{
__shfl_xor_sync(activemask, key, step, 32);
}
}
I expect the __shfl_xor_sync would be migrated into dpct::permute_sub_group_by_xor. However, SYCLomatic does nothing to the code.
after migration:
#include <sycl/sycl.hpp>
#include <dpct/dpct.hpp>
template <typename KeyT, typename ValueT, uint32_t WORKGROUP_SIZE>
class WarpSort{
static void swap(KeyT& key, ValueT& value,
uint32_t const& step, uint32_t const& activemask,
bool bDescending, std::true_type const& isKeyOnly)
{
__shfl_xor_sync(activemask, key, step, 32);
}
To reproduce
#include <cuda_runtime.h>
template <typename KeyT, typename ValueT, uint32_t WORKGROUP_SIZE>
class WarpSort{
__device__ static void swap(KeyT& key, ValueT& value,
uint32_t const& step, uint32_t const& activemask,
bool bDescending, std::true_type const& isKeyOnly)
{
__shfl_xor_sync(activemask, key, step, 32);
}
}
run the above code with dpct
Environment
- OS: Linux
- Target device and vendor: Nvidia GPU
- DPC++ version:Intel(R) oneAPI DPC++/C++ Compiler 2024.2.0 (2024.2.0.20240602)
Additional context
One interesting observation is when you change the type of key into explicit type name such as int& key, the migration success.
before migration:
#include <cuda_runtime.h>
template <typename KeyT, typename ValueT, uint32_t WORKGROUP_SIZE>
class WarpSort{
__device__ static void swap(int& key, ValueT& value,
uint32_t const& step, uint32_t const& activemask,
bool bDescending, std::true_type const& isKeyOnly)
{
__shfl_xor_sync(activemask, key, step, 32);
}
}
after migration:
template <typename KeyT, typename ValueT, uint32_t WORKGROUP_SIZE>
class WarpSort{
static void swap(int& key, ValueT& value,
uint32_t const& step, uint32_t const& activemask,
bool bDescending, std::true_type const& isKeyOnly,
const sycl::nd_item<3> &item_ct1)
{
/*
DPCT1023:0: The SYCL sub-group does not support mask options for
dpct::permute_sub_group_by_xor. You can specify
"--use-experimental-features=masked-sub-group-operation" to use the
experimental helper function to migrate __shfl_xor_sync.
*/
dpct::permute_sub_group_by_xor(item_ct1.get_sub_group(), key, step);
}
- Lingua principale
- LLVM
- Stelle
- 292
- Fork
- 99
- Merge medio
- 5g 5h
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di oneapi-src/SYCLomatic
-
Add Thrust APIsApertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
oneapi-src/SYCLomatic#3018 ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
oneapi-src/SYCLomatic#2962 · 1 commento ·
-
migration of uint3Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
oneapi-src/SYCLomatic#2961 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
oneapi-src/SYCLomatic#2920 · 1 commento ·
-
Hackathon
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
oneapi-src/SYCLomatic#2685 ·
Tutte le issue di oneapi-src/SYCLomatic
Issue simili
-
IO.get_env on Node truncates names at embedded NULForse già presa @Yi-111-a l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
HigherOrderCO/Bend#1449 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
projectM-visualizer/projectm#1043 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
grame-cncm/faust#1344 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno