-
Notifications
You must be signed in to change notification settings - Fork 23
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
SYCL kernels 2 #146
Open
ayarkhan
wants to merge
10
commits into
icl-utk-edu:master
Choose a base branch
from
ayarkhan:sycl-kernels-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
SYCL kernels 2 #146
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0b00f45
Add sycl/device_ kernels and support for sycl complex definitions.
ayarkhan 41cbf01
Build for sycl using sycl/device_ kernels (instead of omptarget).
ayarkhan c47b9e8
Update sycl-kernels to handle multiplication, need for complex (axpby…
ayarkhan 974e9c7
Better separation for sycl build and omptarget-vs-sycl-kernels.
ayarkhan 21d4025
For sycl kernels (generated by dpct tool), remove dependency on dpct/…
ayarkhan 83d345b
In sycl device code, rename some shadow-ed variables.
ayarkhan e983806
Allow CI testing for Intel GPUs.
ayarkhan f7c775a
For sycl-kernels, update CMakefile.
ayarkhan 7935dcb
The Intel C++ flag "Wno-unused-command-line-argument" is set in Make/…
ayarkhan c4ec23e
In sycl/device_tzscale, add missing namespace batch.
ayarkhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,13 +143,13 @@ ifneq ($(cuda),1) | |
endif | ||
endif | ||
|
||
omptarget = 0 | ||
use_omptarget_kernels = 0 | ||
use_sycl_kernels = 0 | ||
ifneq ($(cuda),1) | ||
ifneq ($(hip),1) | ||
ifeq (${gpu_backend},sycl) | ||
# enable the omptarget offload kernels in SLATE for oneMKL-SYCL devices | ||
$(info Note: enabling omp-target-offload kernels) | ||
omptarget = 1 | ||
# enable the kernels in SLATE for oneMKL-SYCL devices | ||
sycl = 1 | ||
|
||
# -Wno-unused-command-line-argument avoids | ||
# icpx warning: -Wl,-rpath,...: 'linker' input unused. | ||
|
@@ -163,7 +163,18 @@ ifneq ($(hip),1) | |
CXXFLAGS += -fsycl -fp-model=precise -Wno-unused-command-line-argument \ | ||
-Wno-c99-extensions -Wno-pass-failed | ||
LIBS += -lsycl | ||
endif | ||
|
||
# How should the slate kernels be compiled | ||
ifeq (${sycl_kernels},omptarget) # src/omptarget kernels | ||
# enable the omptarget offload kernels in SLATE for oneMKL-SYCL devices | ||
use_omptarget_kernels = 1 | ||
else # src/sycl kernels - default/fall-through option | ||
use_sycl_kernels = 1 | ||
CXXFLAGS += -fsycl-unnamed-lambda # allow unnamed sycl lambda kernels | ||
LDFLAGS += -fsycl -fsycl-unnamed-lambda # allow unnamed sycl lambda kernels | ||
endif | ||
|
||
endif | ||
endif | ||
endif | ||
|
||
|
@@ -210,8 +221,13 @@ endif | |
ifeq ($(openmp),1) | ||
ifeq (${gpu_backend},sycl) | ||
# Intel icpx options for OpenMP offload. | ||
CXXFLAGS += -fiopenmp -fopenmp-targets=spir64 | ||
LDFLAGS += -fiopenmp -fopenmp-targets=spir64 | ||
CXXFLAGS += -fiopenmp | ||
LDFLAGS += -fiopenmp | ||
ifeq (${use_omptarget_kernels},1) | ||
# If SYCL + OpenMP-offload-kernels, specify omp device type | ||
CXXFLAGS += -fopenmp-targets=spir64 | ||
LDFLAGS += -fopenmp-targets=spir64 | ||
endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spaces. |
||
else | ||
# Most other compilers recognize this. | ||
CXXFLAGS += -fopenmp | ||
|
@@ -542,6 +558,10 @@ cuda_hdr := \ | |
hip_src := $(patsubst src/cuda/%.cu,src/hip/%.hip.cc,$(cuda_src)) | ||
hip_hdr := $(patsubst src/cuda/%.cuh,src/hip/%.hip.hh,$(cuda_hdr)) | ||
|
||
# SYCL implementations of device kernels | ||
sycl_kernels_src := $(patsubst src/cuda/%.cu,src/sycl/%.dp.cpp,$(cuda_src)) | ||
sycl_kernels_hdr := $(patsubst src/cuda/%.cuh,src/sycl/%.dp.hpp,$(cuda_hdr)) | ||
|
||
# OpenMP implementations of device kernels | ||
omptarget_src := \ | ||
src/omptarget/device_geadd.cc \ | ||
|
@@ -564,6 +584,8 @@ ifeq (${cuda},1) | |
libslate_src += ${cuda_src} | ||
else ifeq (${hip},1) | ||
libslate_src += ${hip_src} | ||
else ifeq ($(use_sycl_kernels),1) | ||
libslate_src += $(sycl_kernels_src) | ||
else | ||
# Used for both OpenMP offload (${omptarget} == 1) and as stubs for | ||
# CPU-only build. | ||
|
@@ -1322,6 +1344,9 @@ hooks: ${hooks} | |
%.hip.o: %.hip.cc | $(hip_hdr) | ||
$(HIPCC) $(HIPCCFLAGS) -c $< -o $@ | ||
|
||
%.dp.o: %.dp.cpp | $(sycl_kernels_hdr) | ||
$(CXX) $(CXXFLAGS) -c $< -o $@ | ||
|
||
%.o: %.cc | ||
$(CXX) $(CXXFLAGS) -c $< -o $@ | ||
|
||
|
@@ -1460,8 +1485,14 @@ echo: | |
@echo "sycl = '$(sycl)'" | ||
@echo | ||
@echo "---------- OMP target-offload kernel options" | ||
@echo "omptarget = '${omptarget}'" | ||
@echo "omptarget = '${use_omptarget_kernels}'" | ||
@echo "omptarget_src = ${omptarget_src}" | ||
@echo "omptarget_hdr = ${omptarget_hdr}" | ||
@echo | ||
@echo "---------- SYCL device kernels" | ||
@echo "sycl_kernels = '$(use_sycl_kernels)'" | ||
@echo "sycl_kernels_src = '$(sycl_kernels_src)'" | ||
@echo "sycl_kernels_hdr = '$(sycl_kernels_hdr)'" | ||
@echo | ||
@echo "---------- Fortran compiler" | ||
@echo "FC = $(FC)" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
In Makefiles, use spaces for
if-else-endif
blocks. Use tabs only for rules.