Removed internal/build. Added hip to dummy.cpp
MODIFY
examples/cmake/add_subdir/dummy.cpp
examples/cmake/add_subdir/dummy.cpp
@@ -22,6 +22,8 @@ int main()
<< "CPP\n";
#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA
<< "CUDA\n";
+#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_HIP
+ << "HIP\n";
#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_OMP
<< "OMP\n";
#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_TBB

DELETE
internal/build/common_build.mk
-USE_NEW_PROJECT_MK := 1
-
-CCCL_ENABLE_DEPRECATIONS := 1
-
-ifeq ($(OS),Linux)
- LIBRARIES += m
-endif
-
-include $(ROOTDIR)/thrust/internal/build/common_compiler.mk
-
-# Add /bigobj to Windows build flag to workaround building Thrust with debug
-ifeq ($(OS),win32)
- CUDACC_FLAGS += -Xcompiler "/bigobj"
-endif
-
-# Add -mthumb for Linux on ARM to work around bug in arm cross compiler from p4
-ifeq ($(TARGET_ARCH),ARMv7)
- ifneq ($(HOST_ARCH),ARMv7)
- ifeq ($(THRUST_TEST),1)
- CUDACC_FLAGS += -Xcompiler "-mthumb"
- endif
- endif
-endif
-
-# Make PGI statically link against its libraries.
-ifeq ($(OS),$(filter $(OS),Linux Darwin))
- ifdef USEPGCXX
- NVCC_LDFLAGS += -Xcompiler "-Bstatic_pgi"
- endif
-endif
-ifeq ($(SRC_PATH),)
- SRC_PATH:=$(dir $(BUILD_SRC))
- BUILD_SRC:=$(notdir $(BUILD_SRC))
-endif
-
-BUILD_SRC_SUFFIX:=$(suffix $(BUILD_SRC))
-
-ifeq ($(BUILD_SRC_SUFFIX),.cu)
- CU_FILES += $(BUILD_SRC)
-else ifeq ($(BUILD_SRC_SUFFIX),.cpp)
- FILES += $(BUILD_SRC)
-endif
-
-ifndef BUILD_AGAINST_RELEASE
- # CUDA includes
- ifdef VULCAN
- INCLUDES_ABSPATH += $(VULCAN_INSTALL_DIR)/cuda/include
- INCLUDES_ABSPATH += $(VULCAN_INSTALL_DIR)/cuda/_internal/cudart
- else
- INCLUDES_ABSPATH += $(ROOTDIR)/cuda/inc
- INCLUDES_ABSPATH += $(ROOTDIR)/cuda/tools/cudart
- endif
-
- # Thrust includes
- ifdef VULCAN
- INCLUDES_ABSPATH += $(VULCAN_TOOLKIT_BASE)/thrust
- else
- INCLUDES_ABSPATH += $(ROOTDIR)/thrust
- endif
-
- # CUB includes
- ifdef VULCAN
- INCLUDES_ABSPATH += $(VULCAN_TOOLKIT_BASE)/cub
- else
- INCLUDES_ABSPATH += $(ROOTDIR)/cub
- endif
-else
- # CUDA, CUB, and Thrust includes
- INCLUDES_ABSPATH += $(GPGPU_COMPILER_EXPORT)/include
-
- ifeq ($(TARGET_ARCH),ARMv7)
- LIBDIRS_ABSPATH += $(GPGPU_COMPILER_EXPORT)/lib32
- else
- LIBDIRS_ABSPATH += $(GPGPU_COMPILER_EXPORT)/lib64
- endif
-endif
-
-ifdef VULCAN
- LIBDIRS_ABSPATH += $(VULCAN_BUILD_DIR)/bin/$(VULCAN_ARCH)_$(VULCAN_OS)$(VULCAN_ABI)_$(VULCAN_BUILD)
-endif
-
-USES_CUDA_DRIVER_HEADERS := 1
-
-ifdef VULCAN_TOOLKIT_BASE
- include $(VULCAN_TOOLKIT_BASE)/build/common.mk
-else
- include $(ROOTDIR)/build/common.mk
-endif
-

DELETE
internal/build/common_compiler.mk
-ifeq ($(OS),$(filter $(OS),Linux Darwin))
- ifndef USEPGCXX
- CUDACC_FLAGS += -Xcompiler "-Wall -Wextra -Werror"
-
- ifdef USEXLC
- CXX_STD := c++14
-
- # GCC does not warn about unused parameters in uninstantiated
- # template functions, but xlC does. This causes xlC to choke on the
- # OMP backend, which is mostly #ifdef'd out when you aren't using it.
- CUDACC_FLAGS += -Xcompiler "-Wno-unused-parameter"
-
- # xlC is unreasonable about unused functions in a translation unit
- # when this warning is enabled; this includes warning on most functions
- # that are defined as static inline in cuda_fp16.h. Disable this warning
- # entirely under xlC.
- CUDACC_FLAGS += -Xcompiler "-Wno-unused-function"
- else # GCC, ICC or Clang AKA the sane ones.
- # XXX Enable -Wcast-align.
- CUDACC_FLAGS += -Xcompiler "-Winit-self -Woverloaded-virtual -Wno-cast-align -Wcast-qual -Wno-long-long -Wno-variadic-macros -Wno-unused-function"
-
- ifdef USE_CLANGLLVM
- IS_CLANG := 1
- endif
-
- ifeq ($(ABITYPE), androideabi)
- ifneq ($(findstring clang, $(BASE_COMPILER)),)
- IS_CLANG := 1
- endif
- endif
-
- ifeq ($(OS), Darwin)
- IS_CLANG := 1
- endif
-
- ifdef IS_CLANG
- CXX_STD := c++14
-
- ifdef USE_CLANGLLVM
- CLANG_VERSION = $(shell $(USE_CLANGLLVM) --version 2>/dev/null | head -1 | sed -e 's/.*\([0-9]\)\.\([0-9]\)\(\.[0-9]\).*/\1\2/g')
- else
- CLANG_VERSION = $(shell $(CCBIN) --version 2>/dev/null | head -1 | sed -e 's/.*\([0-9]\)\.\([0-9]\)\(\.[0-9]\).*/\1\2/g')
- endif
-
- # GCC does not warn about unused parameters in uninstantiated
- # template functions, but Clang does. This causes Clang to choke on the
- # OMP backend, which is mostly #ifdef'd out when you aren't using it.
- CUDACC_FLAGS += -Xcompiler "-Wno-unused-parameter"
-
- # -Wunneeded-internal-declaration misfires in the unit test framework
- # on older versions of Clang.
- CUDACC_FLAGS += -Xcompiler "-Wno-unneeded-internal-declaration"
-
- ifeq ($(shell if test $(CLANG_VERSION) -ge 60; then echo true; fi),true)
- # Clang complains about name mangling changes due to `noexcept`
- # becoming part of the type system; we don't care.
- CUDACC_FLAGS += -Xcompiler "-Wno-noexcept-type"
- endif
- else # GCC
- ifdef CCBIN
- CCBIN_ENVIRONMENT :=
- ifeq ($(OS), QNX)
- # QNX's GCC complains if QNX_HOST and QNX_TARGET aren't defined in the
- # environment.
- CCBIN_ENVIRONMENT := QNX_HOST=$(QNX_HOST) QNX_TARGET=$(QNX_TARGET)
- endif
-
- # Newer versions of GCC only print the major number with the
- # -dumpversion flag, but they print all three with -dumpfullversion.
- GCC_VERSION = $(shell $(CCBIN_ENVIRONMENT) $(CCBIN) -dumpfullversion 2>/dev/null | sed -e 's/\([0-9]\)\.\([0-9]\)\(\.[0-9]\)\?/\1\2/g')
-
- ifeq ($(GCC_VERSION),)
- # Older versions of GCC (~4.4 and older) seem to print three version
- # numbers (major, minor and patch) with the -dumpversion flag; newer
- # versions only print one or two numbers.
- GCC_VERSION = $(shell $(CCBIN_ENVIRONMENT) $(CCBIN) -dumpversion | sed -e 's/\([0-9]\)\.\([0-9]\)\(\.[0-9]\)\?/\1\2/g')
- endif
-
- ifeq ($(shell if test $(GCC_VERSION) -ge 50; then echo true; fi),true)
- CXX_STD := c++14
- else
- CUDACC_FLAGS += -DTHRUST_IGNORE_DEPRECATED_CPP_DIALECT
- endif
-
- ifeq ($(shell if test $(GCC_VERSION) -ge 73; then echo true; fi),true)
- # GCC 7.3 complains about name mangling changes due to `noexcept`
- # becoming part of the type system; we don't care.
- CUDACC_FLAGS += -Xcompiler "-Wno-noexcept-type"
- endif
- ifeq ($(shell if test $(GCC_VERSION) -ge 80; then echo true; fi),true)
- # GCC 8.x has a new warning that tries to diagnose technical misuses of
- # memcpy and memmove. We need to resolve it better than this, but for the
- # time being, we'll downgrade it from an error to a warning.
- CUDACC_FLAGS += -Xcompiler "-Wno-error=class-memaccess"
- endif
- else
- $(error CCBIN is not defined.)
- endif
- endif
- endif
- else
- CXX_STD := c++14
- endif
-else ifeq ($(OS),win32)
- CXX_STD := c++14
-
- # XXX Enable /Wall
- CUDACC_FLAGS += -Xcompiler "/WX"
-
- # Disabled loss-of-data conversion warnings.
- # XXX Re-enable.
- CUDACC_FLAGS += -Xcompiler "/wd4244 /wd4267"
-
- # Suppress numeric conversion-to-bool warnings.
- # XXX Re-enable.
- CUDACC_FLAGS += -Xcompiler "/wd4800"
-
- # Disable warning about applying unary - to unsigned type.
- CUDACC_FLAGS += -Xcompiler "/wd4146"
-
- # Warning about declspec(allocator) on inappropriate function types
- CUDACC_FLAGS += -Xcompiler "/wd4494"
-
- # Allow tests to have lots and lots of sections in each translation unit:
- CUDACC_FLAGS += -Xcompiler "/bigobj"
-endif
-
-# Promote all NVCC warnings into errors
-CUDACC_FLAGS += -Werror all-warnings
-
-# Print warning numbers with cudafe diagnostics
-CUDACC_FLAGS += -Xcudafe --display_error_number
-
-VERSION_FLAG :=
-ifeq ($(OS),$(filter $(OS),Linux Darwin))
- ifdef USEPGCXX # PGI
- VERSION_FLAG := -V
- else
- ifdef USEXLC # XLC
- VERSION_FLAG := -qversion
- else # GCC, ICC or Clang AKA the sane ones.
- VERSION_FLAG := --version
- endif
- endif
-else ifeq ($(OS),win32) # MSVC
- # cl.exe run without any options will print its version info and exit.
- VERSION_FLAG :=
-endif
-
-CCBIN_ENVIRONMENT :=
-ifeq ($(OS), QNX)
- # QNX's GCC complains if QNX_HOST and QNX_TARGET aren't defined in the
- # environment.
- CCBIN_ENVIRONMENT := QNX_HOST=$(QNX_HOST) QNX_TARGET=$(QNX_TARGET)
-endif
-
-$(info #### CCBIN : $(CCBIN))
-$(info #### CCBIN VERSION : $(shell $(CCBIN_ENVIRONMENT) $(CCBIN) $(VERSION_FLAG)))
-$(info #### CXX_STD : $(CXX_STD))
-

DELETE
internal/build/common_detect.mk
-CXX_STD = c++11
-
-ifeq ($(THRUST_TEST),1)
- include $(ROOTDIR)/build/getprofile.mk
- include $(ROOTDIR)/build/config/$(PROFILE).mk
-else
- ifdef VULCAN_TOOLKIT_BASE
- include $(VULCAN_TOOLKIT_BASE)/build/getprofile.mk
- include $(VULCAN_TOOLKIT_BASE)/build/config/$(PROFILE).mk
- else
- include $(ROOTDIR)/build/getprofile.mk
- include $(ROOTDIR)/build/config/$(PROFILE).mk
- endif # VULCAN_TOOLKIT_BASE
-endif # THRUST_TEST
-

DELETE
internal/build/generic_example.mk
-# Generic project mk that is included by examples mk
-EXECUTABLE := $(EXAMPLE_NAME)
-BUILD_SRC := $(ROOTDIR)/thrust/$(EXAMPLE_SRC)
-
-include $(ROOTDIR)/thrust/internal/build/common_detect.mk
-
-EXAMPLE_MAKEFILE := $(join $(dir $(BUILD_SRC)), $(basename $(notdir $(BUILD_SRC))).mk)
-ifneq ("$(wildcard $(EXAMPLE_MAKEFILE))","") # Check if the file exists.
- include $(EXAMPLE_MAKEFILE)
-endif
-
-include $(ROOTDIR)/thrust/internal/build/common_build.mk
-

DELETE
internal/build/generic_test.mk
-# Generic project mk that is included by unit tests mk
-EXECUTABLE := $(TEST_NAME)
-BUILD_SRC := $(ROOTDIR)/thrust/$(TEST_SRC)
-
-ifdef VULCAN
- INCLUDES_ABSPATH += $(VULCAN_TOOLKIT_BASE)/thrust/testing
-else
- INCLUDES_ABSPATH += $(ROOTDIR)/thrust/testing
-endif
-
-PROJ_LIBRARIES += testframework
-
-THRUST_TEST := 1
-
-include $(ROOTDIR)/thrust/internal/build/common_detect.mk
-
-TEST_MAKEFILE := $(join $(dir $(BUILD_SRC)), $(basename $(notdir $(BUILD_SRC))).mk)
-ifneq ("$(wildcard $(TEST_MAKEFILE))","") # Check if the file exists.
- include $(TEST_MAKEFILE)
-endif
-
-include $(ROOTDIR)/thrust/internal/build/common_build.mk
-

DELETE
internal/build/warningstester.mk
-USE_NEW_PROJECT_MK := 1
-
-EXECUTABLE := warningstester
-PROJ_DIR := internal/build
-#GENCODE :=
-
-ifndef PROFILE
-ifdef VULCAN_TOOLKIT_BASE
-include $(VULCAN_TOOLKIT_BASE)/build/getprofile.mk
-include $(VULCAN_TOOLKIT_BASE)/build/config/$(PROFILE).mk
-else
-include $(ROOTDIR)/build/getprofile.mk
-include $(ROOTDIR)/build/config/$(PROFILE).mk
-endif
-endif
-
-ARCH_NEG_FILTER += 20 21
-
-ifdef VULCAN_TOOLKIT_BASE
-include $(VULCAN_TOOLKIT_BASE)/build/config/DetectOS.mk
-else
-include $(ROOTDIR)/build/config/DetectOS.mk
-endif
-
-CU_FILES += ../test/warningstester.cu
-
-# Thrust includes
-ifdef VULCAN
-INCLUDES += $(VULCAN_INSTALL_DIR)/cuda/include
-INCLUDES += $(VULCAN_INSTALL_DIR)/cuda/_internal/cudart
-INCLUDES += $(VULCAN_TOOLKIT_BASE)/cub
-else
-INCLUDES += ../..
-INCLUDES += ../../../cuda/tools/cudart
-INCLUDES += ../../../cub
-endif
-
-# Location of generated include file that includes all Thrust public headers
-GENERATED_SOURCES = $(BUILT_CWD)
-CUDACC_FLAGS += -I$(GENERATED_SOURCES)
-
-include $(ROOTDIR)/thrust/internal/build/common_compiler.mk
-
-ifdef VULCAN_TOOLKIT_BASE
-include $(VULCAN_TOOLKIT_BASE)/build/common.mk
-else
-include $(ROOTDIR)/build/common.mk
-endif
-
-warningstester$(OBJSUFFIX): $(GENERATED_SOURCES)/warningstester.h
-
-$(GENERATED_SOURCES)/warningstester.h: FORCE
-ifdef VULCAN
-ifeq ($(TARGET_ARCH), ppc64le)
- $(PYTHON) $(SRC_CWD)/warningstester_create_uber_header.py $(VULCAN_INSTALL_DIR)/cuda/targets/ppc64le-linux/include > $@
-else
- $(PYTHON) $(SRC_CWD)/warningstester_create_uber_header.py $(VULCAN_INSTALL_DIR)/cuda/include > $@
-endif
-else
- $(PYTHON) $(SRC_CWD)/warningstester_create_uber_header.py $(SRC_CWD)/../.. > $@
-endif
-
-FORCE:

DELETE
internal/build/warningstester_create_uber_header.py
-'''
-Helper script for creating a header file that includes all of Thrust's
-public headers. This is useful for instance, to quickly check that
-all the thrust headers obey proper syntax or are warning free.
-
-This script simply outputs a list of C-style #include's to the standard
-output--this should be redirected to a header file by the caller.
-'''
-
-import sys
-import os
-import re
-from stat import *
-
-thrustdir = sys.argv[1]
-
-def find_headers(base_dir, rel_dir, exclude = ['\B']):
- '''
- Recursively find all *.h files inside base_dir/rel_dir,
- except any that match the exclude regexp list
- '''
- assert(type(exclude) == list)
- full_dir = base_dir + '/' + rel_dir
- result = []
- for f in os.listdir(full_dir):
- rel_file = rel_dir + '/' + f
- for e in exclude:
- if re.match(e, rel_file):
- break
- else:
- if f.endswith('.h'):
- result.append(rel_file)
- elif S_ISDIR(os.stat(full_dir + '/' + f).st_mode):
- result.extend(find_headers(base_dir, rel_file, exclude))
- return result
-
-print('/* File is generated by ' + sys.argv[0] + ' */')
-
-exclude_re = ['.*/detail$',
- 'thrust/iterator',
- 'thrust/random',
- 'thrust/system/tbb']
-headers = find_headers(thrustdir, 'thrust', exclude_re)
-
-if len(headers) == 0:
- print('#error no include files found\n')
-
-print('#define THRUST_CPP11_REQUIRED_NO_ERROR')
-print('#define THRUST_CPP14_REQUIRED_NO_ERROR')
-print('#define THRUST_MODERN_GCC_REQUIRED_NO_ERROR')
-for h in headers:
- print('#include <' + h + '>')
-
-exit()

Removed internal/build. Added hip to dummy.cpp