-
Notifications
You must be signed in to change notification settings - Fork 788
add another esimd example #2387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Aleksander Fadeev <[email protected]> Signed-off-by: yanfeng xiao <[email protected]> Co-authored-by: Aleksander Fadeev <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix CI errors
@@ -0,0 +1,221 @@ | |||
//==---------------- matrix_transpose.cpp - DPC++ ESIMD on-device test ----==// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This header is wrong.
#define NUM_BINS 256 | ||
#define SLM_SIZE (NUM_BINS * 4) | ||
#define BLOCK_WIDTH 32 | ||
#define NUM_BLOCKS 32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about some C++?
#define NUM_BINS 256 | |
#define SLM_SIZE (NUM_BINS * 4) | |
#define BLOCK_WIDTH 32 | |
#define NUM_BLOCKS 32 | |
static constexpr int NUM_BINS = 256; | |
static constexpr int SLM_SIZE = NUM_BINS * 4; | |
static constexpr int BLOCK_WIDTH = 32; | |
static constexpr int NUM_BLOCKS = 32; |
return 1; | ||
} | ||
|
||
class ESIMDSelector : public device_selector { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about refactoring this class into a separate file or even put it along with other standard selectors to be available to users?
<< dev_type << "' is not.\n"; | ||
return -1; | ||
} | ||
// If "SYCL_DEVICE_TYPE" not defined, only allow gpu device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why so? If host device is supported, why not let select it automatically?
|
||
HistogramCPU(input_size, input_ptr, cpu_histogram); | ||
|
||
printf("finish cpu_histogram\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++?
printf("finish cpu_histogram\n"); | |
std::cout << "finish cpu_histogram\n"; |
} | ||
}; | ||
|
||
int main(int argc, char *argv[]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't use them anyway.
int main(int argc, char *argv[]) { | |
int main() { |
The Headers for this extension were published so we should use them instead: KhronosGroup/SPIRV-Headers@b73e168 Original commit: KhronosGroup/SPIRV-LLVM-Translator@7d7e0ac5303f93d
[Doc] fix typo in LEVEL_ZERO.rst
histogram using SLM and 256 bins