Skip to content

Commit

Permalink
Add sycl/gen backend and other sycl changes (CEED#1258)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Kris Rowe <[email protected]>
Co-authored-by: Kris Rowe <[email protected]>
Co-authored-by: Jed Brown <[email protected]>
Co-authored-by: Varsha Madananth <[email protected]>
Co-authored-by: James Wright <[email protected]>
  • Loading branch information
6 people authored Jul 20, 2023
1 parent 372821a commit 6ca0f39
Show file tree
Hide file tree
Showing 16 changed files with 1,623 additions and 79 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ OMP_SIMD_FLAG.oneAPI := $(OMP_SIMD_FLAG.clang)
SYCL_FLAG.gcc :=
SYCL_FLAG.clang := -fsycl
SYCL_FLAG.icc :=
SYCL_FLAG.oneAPI := -fsycl
SYCL_FLAG.oneAPI := -fsycl -fno-sycl-id-queries-fit-in-int
OPT.gcc := -g -ffp-contract=fast
OPT.clang := $(OPT.gcc)
OPT.oneAPI := $(OPT.clang)
Expand Down Expand Up @@ -275,6 +275,7 @@ hip-gen.cpp := $(sort $(wildcard backends/hip-gen/*.cpp))
sycl-core.cpp := $(sort $(wildcard backends/sycl/*.sycl.cpp))
sycl-ref.cpp := $(sort $(wildcard backends/sycl-ref/*.sycl.cpp))
sycl-shared.cpp:= $(sort $(wildcard backends/sycl-shared/*.sycl.cpp))
sycl-gen.cpp := $(sort $(wildcard backends/sycl-gen/*.sycl.cpp))

hip-all.c := interface/ceed-hip.c $(hip.c) $(hip-ref.c) $(hip-shared.c) $(hip-gen.c)
hip-all.cpp := $(hip.cpp) $(hip-ref.cpp) $(hip-gen.cpp)
Expand Down Expand Up @@ -453,15 +454,15 @@ ifneq ($(HIP_LIB_DIR),)
endif

# SYCL Backends
SYCL_BACKENDS = /gpu/sycl/ref /gpu/sycl/shared
SYCL_BACKENDS = /gpu/sycl/ref /gpu/sycl/shared /gpu/sycl/gen
ifneq ($(SYCL_DIR),)
SYCL_LIB_DIR := $(wildcard $(foreach d,lib lib64,$(SYCL_DIR)/$d/libsycl.${SO_EXT}))
SYCL_LIB_DIR := $(patsubst %/,%,$(dir $(firstword $(SYCL_LIB_DIR))))
endif
ifneq ($(SYCL_LIB_DIR),)
PKG_LIBS += $(SYCL_FLAG) -lze_loader
LIBCEED_CONTAINS_CXX = 1
libceed.sycl += $(sycl-core.cpp) $(sycl-ref.cpp) $(sycl-shared.cpp)
libceed.sycl += $(sycl-core.cpp) $(sycl-ref.cpp) $(sycl-shared.cpp) $(sycl-gen.cpp)
BACKENDS_MAKE += $(SYCL_BACKENDS)
endif

Expand Down Expand Up @@ -556,6 +557,9 @@ $(OBJDIR)/%.o : $(CURDIR)/%.hip.cpp | $$(@D)/.DIR
$(OBJDIR)/%.o : $(CURDIR)/%.sycl.cpp | $$(@D)/.DIR
$(call quiet,SYCLCXX) $(SYCLFLAGS) $(CPPFLAGS) -c -o $@ $(abspath $<)

$(OBJDIR)/%.o : $(CURDIR)/%.sycl.cpp | $$(@D)/.DIR
$(call quiet,SYCLCXX) $(SYCLFLAGS) $(CPPFLAGS) -c -o $@ $(abspath $<)

$(OBJDIR)/%$(EXE_SUFFIX) : tests/%.c | $$(@D)/.DIR
$(call quiet,LINK.c) $(CEED_LDFLAGS) -o $@ $(abspath $<) $(CEED_LIBS) $(CEED_LDLIBS) $(LDLIBS)

Expand Down
1 change: 1 addition & 0 deletions backends/ceed-backend-list.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ CEED_BACKEND(CeedRegister_Hip_Gen, 1, "/gpu/hip/gen")
CEED_BACKEND(CeedRegister_Hip_Shared, 1, "/gpu/hip/shared")
CEED_BACKEND(CeedRegister_Sycl, 1, "/gpu/sycl/ref")
CEED_BACKEND(CeedRegister_Sycl_Shared, 1, "/gpu/sycl/shared")
CEED_BACKEND(CeedRegister_Sycl_Gen, 1, "/gpu/sycl/gen")
CEED_BACKEND(CeedRegister_Magma, 2, "/gpu/cuda/magma", "/gpu/hip/magma")
CEED_BACKEND(CeedRegister_Magma_Det, 2, "/gpu/cuda/magma/det", "/gpu/hip/magma/det")
CEED_BACKEND(CeedRegister_Memcheck_Blocked, 1, "/cpu/self/memcheck/blocked")
Expand Down
14 changes: 14 additions & 0 deletions backends/sycl-gen/ceed-sycl-gen-operator-build.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
//
// SPDX-License-Identifier: BSD-2-Clause
//
// This file is part of CEED: http://github.com/ceed

#ifndef _ceed_sycl_gen_operator_build_h
#define _ceed_sycl_gen_operator_build_h

CEED_INTERN int BlockGridCalculate_Sycl_gen(const CeedInt dim, const CeedInt P_1d, const CeedInt Q_1d, CeedInt *block_sizes);
CEED_INTERN int CeedOperatorBuildKernel_Sycl_gen(CeedOperator op);

#endif // _ceed_sycl_gen_operator_build_h
Loading

0 comments on commit 6ca0f39

Please sign in to comment.