Skip to content

[Offload][NFC] Remove all trailing whitespace from offload/ #92578

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

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion offload/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ if (NOT LIBOMPTARGET_LLVM_INCLUDE_DIRS)
message(FATAL_ERROR "Missing definition for LIBOMPTARGET_LLVM_INCLUDE_DIRS")
endif()

if(DEFINED LIBOMPTARGET_BUILD_CUDA_PLUGIN OR
if(DEFINED LIBOMPTARGET_BUILD_CUDA_PLUGIN OR
DEFINED LIBOMPTARGET_BUILD_AMDGPU_PLUGIN)
message(WARNING "Option removed, use 'LIBOMPTARGET_PLUGINS_TO_BUILD' instead")
endif()
Expand Down
2 changes: 1 addition & 1 deletion offload/DeviceRTL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ set(src_files
# vectorized accesses to the shared state. Generally, those are "good" but
# the optimizer pipeline (esp. Attributor) does not fully support vectorized
# instructions yet and we end up missing out on way more important constant
# propagation. That said, we will run the vectorizer again after the runtime
# propagation. That said, we will run the vectorizer again after the runtime
# has been linked into the user program.
set(clang_opt_flags -O3 -mllvm -openmp-opt-disable -DSHARED_SCRATCHPAD_SIZE=512 -mllvm -vectorize-slp=false )
set(link_opt_flags -O3 -openmp-opt-disable -attributor-enable=module -vectorize-slp=false )
Expand Down
2 changes: 1 addition & 1 deletion offload/plugins-nextgen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function(add_target_library target_name lib_name)
PluginCommon ${OPENMP_PTHREAD_LIB})

target_compile_definitions(${target_name} PRIVATE TARGET_NAME=${lib_name})
target_compile_definitions(${target_name} PRIVATE
target_compile_definitions(${target_name} PRIVATE
DEBUG_PREFIX="TARGET ${lib_name} RTL")
set_target_properties(${target_name} PROPERTIES POSITION_INDEPENDENT_CODE ON)
endfunction()
Expand Down
2 changes: 1 addition & 1 deletion offload/plugins-nextgen/amdgpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ endif()
option(LIBOMPTARGET_FORCE_AMDGPU_TESTS "Build AMDGPU libomptarget tests" OFF)
if (LIBOMPTARGET_FOUND_AMDGPU_GPU OR LIBOMPTARGET_FORCE_AMDGPU_TESTS)
# Report to the parent scope that we are building a plugin for amdgpu
set(LIBOMPTARGET_SYSTEM_TARGETS
set(LIBOMPTARGET_SYSTEM_TARGETS
"${LIBOMPTARGET_SYSTEM_TARGETS} amdgcn-amd-amdhsa" PARENT_SCOPE)
list(APPEND LIBOMPTARGET_TESTED_PLUGINS "omptarget.rtl.amdgpu")
set(LIBOMPTARGET_TESTED_PLUGINS "${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
Expand Down
2 changes: 1 addition & 1 deletion offload/plugins-nextgen/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ target_compile_definitions(PluginCommon PRIVATE
target_compile_options(PluginCommon PUBLIC ${offload_compile_flags})
target_link_options(PluginCommon PUBLIC ${offload_link_flags})

target_include_directories(PluginCommon PUBLIC
target_include_directories(PluginCommon PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${LIBOMPTARGET_LLVM_INCLUDE_DIRS}
${LIBOMPTARGET_BINARY_INCLUDE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion offload/plugins-nextgen/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif()
option(LIBOMPTARGET_FORCE_NVIDIA_TESTS "Build NVIDIA libomptarget tests" OFF)
if (LIBOMPTARGET_FOUND_NVIDIA_GPU OR LIBOMPTARGET_FORCE_NVIDIA_TESTS)
libomptarget_say("Enable tests using CUDA plugin")
set(LIBOMPTARGET_SYSTEM_TARGETS
set(LIBOMPTARGET_SYSTEM_TARGETS
"${LIBOMPTARGET_SYSTEM_TARGETS} nvptx64-nvidia-cuda nvptx64-nvidia-cuda-LTO" PARENT_SCOPE)
list(APPEND LIBOMPTARGET_TESTED_PLUGINS "omptarget.rtl.cuda")
set(LIBOMPTARGET_TESTED_PLUGINS "${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
Expand Down
10 changes: 5 additions & 5 deletions offload/plugins-nextgen/host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@ endif()

# Define the target specific triples and ELF machine values.
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le$")
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
"powerpc64le-ibm-linux-gnu" "powerpc64le-ibm-linux-gnu-LTO")
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64$")
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
"powerpc64-ibm-linux-gnu" "powerpc64-ibm-linux-gnu-LTO")
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64$")
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
"x86_64-pc-linux-gnu" "x86_64-pc-linux-gnu-LTO")
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64$")
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
"aarch64-unknown-linux-gnu" "aarch64-unknown-linux-gnu-LTO")
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x$")
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
list(APPEND LIBOMPTARGET_SYSTEM_TARGETS
"s390x-ibm-linux-gnu" "s390x-ibm-linux-gnu-LTO")
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
endif()
2 changes: 1 addition & 1 deletion offload/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ add_llvm_library(omptarget
NO_INSTALL_RPATH
BUILDTREE_ONLY
)
target_include_directories(omptarget PRIVATE
target_include_directories(omptarget PRIVATE
${LIBOMPTARGET_INCLUDE_DIR} ${LIBOMPTARGET_BINARY_INCLUDE_DIR}
)

Expand Down
2 changes: 1 addition & 1 deletion offload/test/mapping/array_section_implicit_capture.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %libomptarget-compile-generic
// RUN: %libomptarget-compile-generic
// RUN: %libomptarget-run-generic 2>&1 \
// RUN: | %fcheck-generic

Expand Down
2 changes: 1 addition & 1 deletion offload/test/offloading/default_thread_limit.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main() {
optnone();
}
// DEFAULT: [[NT:(128|256)]] (MaxFlatWorkGroupSize: [[NT]]
#pragma omp target
#pragma omp target
#pragma omp teams distribute parallel for
for (int i = 0; i < N; ++i) {
optnone();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
! Basic offloading test of arrays with provided lower
! Basic offloading test of arrays with provided lower
! and upper bounds as specified by OpenMP's sectioning
! REQUIRES: flang
! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
Expand All @@ -20,7 +20,7 @@ program main
i = i + 1
end do
!$omp end target

print *, write_arr(:)
end program

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ program main
implicit none
integer :: inArray(3,3,3)
integer :: outArray(3,3,3)
integer :: i, j, k
integer :: i, j, k
integer :: j2 = 3, k2 = 3

do i = 1, 3
Expand All @@ -25,7 +25,7 @@ program main
end do

j = 1
k = 1
k = 1
!$omp target map(tofrom:inArray(1:3, 1:3, 2:2), outArray(1:3, 1:3, 1:3), j, k, j2, k2)
do while (j <= j2)
k = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
! Offloading test with two target regions mapping the same
! declare target Fortran array and writing some values to
! it before checking the host correctly receives the
! declare target Fortran array and writing some values to
! it before checking the host correctly receives the
! correct updates made on the device.
! REQUIRES: flang
! UNSUPPORTED: nvptx64-nvidia-cuda
Expand Down Expand Up @@ -35,7 +35,7 @@ program main
i = i + 1
end do
!$omp end target

print *, sp(:)

end program
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,55 +11,55 @@
! RUN: %libomptarget-compile-fortran-run-and-check-generic
module test
contains
subroutine func_arg(arg_alloc)
subroutine func_arg(arg_alloc)
integer, allocatable, intent (inout) :: arg_alloc(:)
!$omp target map(tofrom: arg_alloc)

!$omp target map(tofrom: arg_alloc)
do index = 1, 10
arg_alloc(index) = arg_alloc(index) + index
end do
!$omp end target

print *, arg_alloc
end subroutine func_arg
end module
subroutine func
integer, allocatable :: local_alloc(:)
end module

subroutine func
integer, allocatable :: local_alloc(:)
allocate(local_alloc(10))
!$omp target map(tofrom: local_alloc)

!$omp target map(tofrom: local_alloc)
do index = 1, 10
local_alloc(index) = index
end do
!$omp end target

print *, local_alloc

deallocate(local_alloc)
end subroutine func
program main
use test
integer, allocatable :: map_ptr(:)
end subroutine func


program main
use test
integer, allocatable :: map_ptr(:)

allocate(map_ptr(10))
!$omp target map(tofrom: map_ptr)

!$omp target map(tofrom: map_ptr)
do index = 1, 10
map_ptr(index) = index
end do
!$omp end target

call func
call func

print *, map_ptr

call func_arg(map_ptr)

deallocate(map_ptr)
end program
end program

! CHECK: 1 2 3 4 5 6 7 8 9 10
! CHECK: 1 2 3 4 5 6 7 8 9 10
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Offloading test checking interaction of an
! explicit derived type mapping when mapped
! explicit derived type mapping when mapped
! to target and assinging one derived type
! to another
! REQUIRES: flang, amdgcn-amd-amdhsa
Expand All @@ -16,22 +16,22 @@ program main
integer(4) :: ix = 0
real(4) :: rx = 0.0
complex(4) :: zx = (0,0)
end type scalar
end type scalar

type(scalar) :: in
type(scalar) :: out
in%ix = 10
in%rx = 2.0
in%zx = (2, 10)

!$omp target map(from:out) map(to:in)
out = in
out = in
!$omp end target

print*, in%ix
print*, in%rx
write (*,*) in%zx

print*, out%ix
print*, out%rx
write (*,*) out%zx
Expand Down
20 changes: 10 additions & 10 deletions offload/test/offloading/fortran/target-map-derived-type-full-2.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Offloading test checking interaction of an
! explicit derived type mapping when mapped to
! explicit derived type mapping when mapped to
! target and assigning to individual members
! REQUIRES: flang, amdgcn-amd-amdhsa
! UNSUPPORTED: nvptx64-nvidia-cuda
Expand All @@ -16,29 +16,29 @@ program main
real(4) :: rx = 0.0
complex(4) :: zx = (0,0)
integer(4) :: array(5)
end type scalar
end type scalar

type(scalar) :: out
type(scalar) :: in

in%ix = 10
in%rx = 2.0
in%zx = (2, 10)

do i = 1, 5
in%array(i) = i
end do
end do

!$omp target map(from:out) map(to:in)
out%ix = in%ix
out%rx = in%rx
out%zx = in%zx

do i = 1, 5
out%array(i) = in%array(i)
end do
end do
!$omp end target

print*, in%ix
print*, in%rx
print*, in%array
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Offloading test checking interaction of an
! implicit derived type mapping when mapped
! implicit derived type mapping when mapped
! to target and assinging one derived type
! to another
! REQUIRES: flang, amdgcn-amd-amdhsa
Expand All @@ -16,18 +16,18 @@ program main
integer(4) :: ix = 0
real(4) :: rx = 0.0
complex(4) :: zx = (0,0)
end type scalar
end type scalar

type(scalar) :: in
type(scalar) :: out
in%ix = 10
in%rx = 2.0
in%zx = (2, 10)

!$omp target map(from:out)
out = in
out = in
!$omp end target

print*, in%ix
print*, in%rx
write (*,*) in%zx
Expand All @@ -43,4 +43,3 @@ end program main
!CHECK: 10
!CHECK: 2.
!CHECK: (2.,10.)

Loading
Loading