Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Enable shared memory by default #534

Merged
merged 9 commits into from
Jun 28, 2023
Merged

Enable shared memory by default #534

merged 9 commits into from
Jun 28, 2023

Conversation

kurapov-peter
Copy link
Contributor

The PR adds proper code generation for Intel GPUs.

Notes:

  • The shared buffer is allocated statically within the genx.ll module and its size is not checked for now.
  • L0 backend now uses smem by default.
  • There was an issue with cgen: emitCall would use the wrong runtime module. This is now fixed by patching the module triple upon extension module load.
  • We currently produce some redundant address space casts between generic and shared-local. Those produce actual runtime checks and affect perf. I left the warnings in the log.

@Garra1980
Copy link
Contributor

Any specific tests for sh mem or existing set is enough?

  • We currently produce some redundant address space casts between generic and shared-local. Those produce actual runtime checks and affect perf. I left the warnings in the log.

Is it worth to be handled as a separate issue?

@kurapov-peter
Copy link
Contributor Author

Yes, we'll have some smem specific tests. Address space casts will be addressed separately.

@kurapov-peter
Copy link
Contributor Author

The pass rate is now decent, so this is ready for review.

%no_skip = icmp ne i64 %val, %skip_val
br i1 %no_skip, label %.noskip, label %.skip
.noskip:
%old = call i64 @agg_count(i64* %agg, i64 %val)
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if shared_mem is turned off? What function implementation do we fall back to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just noticed the comment. I haven't tested it, but what should happen is it should emit the agg_count from the "cpu" runtime module instead. BTW, I'm not sure if we need the option to disable shared memory at all :)

@alexbaden alexbaden merged commit 9d80768 into main Jun 28, 2023
@alexbaden alexbaden deleted the pakurapo/smem-by-default branch June 28, 2023 02:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants