Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
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

add another esimd example #2387

Closed
wants to merge 2 commits into from
Closed

add another esimd example #2387

wants to merge 2 commits into from

Conversation

cmc-rep
Copy link
Contributor

@cmc-rep cmc-rep commented Aug 28, 2020

histogram using SLM and 256 bins

yanfeng3721 and others added 2 commits August 28, 2020 16:40
Signed-off-by: Aleksander Fadeev <aleksander.fadeev@intel.com>
Signed-off-by: yanfeng xiao <yanfeng.xiao@intel.com>

Co-authored-by: Aleksander Fadeev <aleksander.fadeev@intel.com>
@cmc-rep cmc-rep requested a review from a team as a code owner August 28, 2020 23:44
Copy link
Contributor

@alexbatashev alexbatashev left a 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 ----==//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This header is wrong.

Comment on lines +20 to +23
#define NUM_BINS 256
#define SLM_SIZE (NUM_BINS * 4)
#define BLOCK_WIDTH 32
#define NUM_BLOCKS 32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about some C++?

Suggested change
#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 {
Copy link
Contributor

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
Copy link
Contributor

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");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++?

Suggested change
printf("finish cpu_histogram\n");
std::cout << "finish cpu_histogram\n";

}
};

int main(int argc, char *argv[]) {
Copy link
Contributor

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.

Suggested change
int main(int argc, char *argv[]) {
int main() {

@cmc-rep cmc-rep closed this Aug 31, 2020
@cmc-rep cmc-rep deleted the cmc-rep-change branch August 31, 2020 15:15
jsji pushed a commit that referenced this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants