[Openmp-commits] [openmp] r205909 - Add the offload directory which contains the code needed to support

Jim Cownie james.h.cownie at intel.com
Wed Apr 9 08:40:24 PDT 2014


Author: jimcownie
Date: Wed Apr  9 10:40:23 2014
New Revision: 205909

URL: http://llvm.org/viewvc/llvm-project?rev=205909&view=rev
Log:
Add the offload directory which contains the code needed to support
OpenMP 4.0 "target" directives. This will need more work for
generality, but we want to get it out and visible to the community.

Added:
    openmp/trunk/offload/
    openmp/trunk/offload/Makefile   (with props)
    openmp/trunk/offload/README.txt   (with props)
    openmp/trunk/offload/doc/
    openmp/trunk/offload/doc/Reference.pdf
    openmp/trunk/offload/doc/doxygen/
    openmp/trunk/offload/doc/doxygen/config   (with props)
    openmp/trunk/offload/doc/doxygen/header.tex   (with props)
    openmp/trunk/offload/src/
    openmp/trunk/offload/src/cean_util.cpp
    openmp/trunk/offload/src/cean_util.h
    openmp/trunk/offload/src/coi/
    openmp/trunk/offload/src/coi/coi_client.cpp
    openmp/trunk/offload/src/coi/coi_client.h
    openmp/trunk/offload/src/coi/coi_server.cpp
    openmp/trunk/offload/src/coi/coi_server.h
    openmp/trunk/offload/src/compiler_if_host.cpp
    openmp/trunk/offload/src/compiler_if_host.h
    openmp/trunk/offload/src/compiler_if_target.cpp
    openmp/trunk/offload/src/compiler_if_target.h
    openmp/trunk/offload/src/dv_util.cpp
    openmp/trunk/offload/src/dv_util.h
    openmp/trunk/offload/src/liboffload_error.c
    openmp/trunk/offload/src/liboffload_error_codes.h
    openmp/trunk/offload/src/liboffload_msg.c
    openmp/trunk/offload/src/liboffload_msg.h
    openmp/trunk/offload/src/mic_lib.f90
    openmp/trunk/offload/src/offload.h
    openmp/trunk/offload/src/offload_common.cpp
    openmp/trunk/offload/src/offload_common.h
    openmp/trunk/offload/src/offload_engine.cpp
    openmp/trunk/offload/src/offload_engine.h
    openmp/trunk/offload/src/offload_env.cpp
    openmp/trunk/offload/src/offload_env.h
    openmp/trunk/offload/src/offload_host.cpp
    openmp/trunk/offload/src/offload_host.h
    openmp/trunk/offload/src/offload_myo_host.cpp
    openmp/trunk/offload/src/offload_myo_host.h
    openmp/trunk/offload/src/offload_myo_target.cpp
    openmp/trunk/offload/src/offload_myo_target.h
    openmp/trunk/offload/src/offload_omp_host.cpp
    openmp/trunk/offload/src/offload_omp_target.cpp
    openmp/trunk/offload/src/offload_orsl.cpp
    openmp/trunk/offload/src/offload_orsl.h
    openmp/trunk/offload/src/offload_table.cpp
    openmp/trunk/offload/src/offload_table.h
    openmp/trunk/offload/src/offload_target.cpp
    openmp/trunk/offload/src/offload_target.h
    openmp/trunk/offload/src/offload_target_main.cpp
    openmp/trunk/offload/src/offload_timer.h
    openmp/trunk/offload/src/offload_timer_host.cpp
    openmp/trunk/offload/src/offload_timer_target.cpp
    openmp/trunk/offload/src/offload_trace.cpp
    openmp/trunk/offload/src/offload_trace.h
    openmp/trunk/offload/src/offload_util.cpp
    openmp/trunk/offload/src/offload_util.h
    openmp/trunk/offload/src/ofldbegin.cpp
    openmp/trunk/offload/src/ofldend.cpp
    openmp/trunk/offload/src/orsl-lite/
    openmp/trunk/offload/src/orsl-lite/include/
    openmp/trunk/offload/src/orsl-lite/include/orsl-lite.h
    openmp/trunk/offload/src/orsl-lite/lib/
    openmp/trunk/offload/src/orsl-lite/lib/orsl-lite.c
    openmp/trunk/offload/src/orsl-lite/version.txt
    openmp/trunk/offload/src/rdtsc.h
    openmp/trunk/offload/src/use_mpss2.txt
    openmp/trunk/offload/src/use_mpss_win.txt
Modified:
    openmp/trunk/www/index.html

Added: openmp/trunk/offload/Makefile
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/offload/Makefile?rev=205909&view=auto
==============================================================================
--- openmp/trunk/offload/Makefile (added)
+++ openmp/trunk/offload/Makefile Wed Apr  9 10:40:23 2014
@@ -0,0 +1,208 @@
+#
+##//===----------------------------------------------------------------------===//
+#//
+#//                     The LLVM Compiler Infrastructure
+#//
+#// This file is dual licensed under the MIT and the University of Illinois Open
+#// Source Licenses. See LICENSE.txt for details.
+#//
+#//===----------------------------------------------------------------------===//
+#
+
+# MAKEFILE PARAMETERS
+#
+# root_dir - path to root directory of liboffload
+# build_dir - path to build directory
+# mpss_dir - path to root directory of mpss
+# libiomp_host_dir - path to host libiomp directory (unnecessary if compiler_host is icc)
+# libiomp_target_dir - path to target libiomp directory (unnecesarry if compiler_target is icc)
+# omp_header_dir - path to omp.h (unnecessary if compiler_host and compiler_target are icc)
+# os_host - host operating system
+# os_target - target operating system
+# compiler_host - host compiler
+# compiler_target - target compiler
+# options_host - additional options for host compiler
+# options_target - additional options for target compiler
+#
+
+# Directories
+root_dir?=.
+build_dir?=$(root_dir)/build
+build_host_dir=$(build_dir)/host
+build_target_dir=$(build_dir)/target
+obj_host_dir=$(build_dir)/obj_host
+obj_target_dir=$(build_dir)/obj_target
+source_dir=$(root_dir)/src
+imported_dir=$(source_dir)/imported
+
+# OS
+os_host?=linux
+os_target?=linux
+ifneq ($(os_host)_$(os_target), linux_linux)
+  $(error "Only linux is supported")
+endif
+
+# Compilers
+compiler_host?=gcc
+compiler_target?=gcc
+
+# MPSS
+mpss_dir?=/
+mpss_present=$(shell if test -d $(mpss_dir); then echo OK; else echo KO; fi)
+ifneq ($(mpss_present), OK)
+  $(error "Cannot find MPSS directory $(mpss_dir)")
+endif
+
+coi_dir=$(mpss_dir)/opt/intel/mic/coi
+myo_dir=$(mpss_dir)/opt/intel/mic/myo
+
+# Sources
+src_liboffload_common=dv_util.cpp liboffload_error.c liboffload_msg.c offload_common.cpp offload_table.cpp offload_trace.cpp offload_util.cpp
+
+src_liboffload_host=$(src_liboffload_common) cean_util.cpp coi/coi_client.cpp compiler_if_host.cpp offload_engine.cpp offload_env.cpp offload_host.cpp offload_omp_host.cpp offload_timer_host.cpp offload_orsl.cpp orsl-lite/lib/orsl-lite.c offload_myo_host.cpp
+src_liboffload_host:=$(foreach file,$(src_liboffload_host),$(source_dir)/$(file))
+
+src_liboffload_target=$(src_liboffload_common) coi/coi_server.cpp compiler_if_target.cpp offload_omp_target.cpp offload_target.cpp offload_timer_target.cpp offload_myo_target.cpp
+src_liboffload_target:=$(foreach file,$(src_liboffload_target),$(source_dir)/$(file))
+
+src_ofld=ofldbegin.cpp ofldend.cpp
+src_ofld:=$(foreach file,$(src_ofld),$(source_dir)/$(file))
+
+headers=$(wildcard $(source_dir)/*.h) $(wildcard $(source_dir)/coi/*.h) $(wildcard $(source_dir)/orsl-lite/include/*.h)
+ifneq ($(omp_header_dir), )
+  headers+=$(imported_dir)/omp.h
+endif
+
+# Objects
+obj_liboffload_host=$(notdir $(src_liboffload_host))
+obj_liboffload_host:=$(obj_liboffload_host:.cpp=.o)
+obj_liboffload_host:=$(obj_liboffload_host:.c=.o)
+obj_liboffload_host:=$(foreach file,$(obj_liboffload_host),$(obj_host_dir)/$(file))
+
+obj_liboffload_target=$(notdir $(src_liboffload_target))
+obj_liboffload_target:=$(obj_liboffload_target:.cpp=.o)
+obj_liboffload_target:=$(obj_liboffload_target:.c=.o)
+obj_liboffload_target:=$(foreach file,$(obj_liboffload_target),$(obj_target_dir)/$(file))
+
+obj_ofld=$(notdir $(src_ofld))
+obj_ofld:=$(obj_ofld:.cpp=.o)
+obj_ofld_host=$(foreach file,$(obj_ofld),$(build_host_dir)/$(file))
+obj_ofld_target=$(foreach file,$(obj_ofld),$(build_target_dir)/$(file))
+
+# Options
+opts_common=-O2 -w -fpic -c -DCOI_LIBRARY_VERSION=2 -DMYO_SUPPORT -DOFFLOAD_DEBUG=1 -DSEP_SUPPORT -DTIMING_SUPPORT -I$(coi_dir)/include -I$(myo_dir)/include -I$(source_dir)
+ifneq ($(omp_header_dir), )
+  opts_common+=-I$(imported_dir)
+endif
+
+opts_liboffload=-shared -Wl,-soname,liboffload.so.5 -ldl -lstdc++ -liomp5
+
+opts_liboffload_host=$(opts_liboffload) -L$(coi_dir)/host-linux-release/lib -lcoi_host -L$(myo_dir)/lib -lmyo-client
+ifneq ($(libiomp_host_dir), )
+  opts_liboffload_host+=-L$(libiomp_host_dir)
+endif
+
+opts_liboffload_target=$(opts_liboffload) -L$(coi_dir)/device-linux-release/lib -lcoi_device -L$(myo_dir)/lib -lmyo-service
+ifneq ($(libiomp_target_dir), )
+  opts_liboffload_target+=-L$(libiomp_target_dir)
+endif
+
+options_host?=
+opts_host=$(options_host) -DHOST_LIBRARY=1
+ifeq ($(os_host), linux)
+  opts_host+=-DLINUX
+endif
+
+options_target?=
+opts_target=$(options_target) -DHOST_LIBRARY=0
+ifeq ($(os_target), linux)
+  opts_target+=-DLINUX
+endif
+
+# Make targets
+.PHONY: all clean info
+
+all: info $(build_host_dir)/liboffload.so $(build_target_dir)/liboffload.so $(obj_ofld_host) $(obj_ofld_target)
+
+
+$(build_host_dir)/liboffload.so: $(build_host_dir)/liboffload.so.5 | $(build_host_dir)
+	ln -f $< $@
+
+$(build_host_dir)/liboffload.so.5: $(obj_liboffload_host) | $(build_host_dir)
+	$(compiler_host) $(opts_liboffload_host) $(opts_host) $^ -o $@
+
+$(obj_host_dir)/%.o: $(source_dir)/%.c $(headers) | $(obj_host_dir)
+	$(compiler_host) $(opts_common) $(opts_host) $< -o $@
+
+$(obj_host_dir)/%.o: $(source_dir)/%.cpp $(headers) | $(obj_host_dir)
+	$(compiler_host) $(opts_common) $(opts_host) $< -o $@
+
+$(obj_host_dir)/%.o: $(source_dir)/coi/%.cpp $(headers) | $(obj_host_dir)
+	$(compiler_host) $(opts_common) $(opts_host) $< -o $@
+
+$(obj_host_dir)/%.o: $(source_dir)/orsl-lite/lib/%.c $(headers) | $(obj_host_dir)
+	$(compiler_host) $(opts_common) $(opts_host) $< -o $@
+
+
+$(build_target_dir)/liboffload.so: $(build_target_dir)/liboffload.so.5 | $(build_target_dir)
+	ln -f $< $@
+
+$(build_target_dir)/liboffload.so.5: $(obj_liboffload_target) | $(build_target_dir)
+	$(compiler_target) $(opts_liboffload_target) $(opts_target) $^ -o $@
+
+$(obj_target_dir)/%.o: $(source_dir)/%.c $(headers) | $(obj_target_dir)
+	$(compiler_target) $(opts_common) $(opts_target) $< -o $@
+
+$(obj_target_dir)/%.o: $(source_dir)/%.cpp $(headers) | $(obj_target_dir)
+	$(compiler_target) $(opts_common) $(opts_target) $< -o $@
+
+$(obj_target_dir)/%.o: $(source_dir)/coi/%.cpp $(headers) | $(obj_target_dir)
+	$(compiler_target) $(opts_common) $(opts_target) $< -o $@
+
+$(obj_target_dir)/%.o: $(source_dir)/orsl-lite/lib/%.c $(headers) | $(obj_target_dir)
+	$(compiler_target) $(opts_common) $(opts_target) $< -o $@
+
+
+$(build_host_dir)/%.o: $(source_dir)/%.cpp $(headers) | $(build_host_dir)
+	$(compiler_host) $(opts_common) $(opts_host) $< -o $@
+
+$(build_target_dir)/%.o: $(source_dir)/%.cpp $(headers) | $(build_target_dir)
+	$(compiler_target) $(opts_common) $(opts_target) $< -o $@
+
+
+$(imported_dir)/omp.h: $(omp_header_dir)/omp.h | $(imported_dir)
+	cp $< $@
+
+
+$(build_host_dir) $(build_target_dir) $(obj_host_dir) $(obj_target_dir): | $(build_dir)
+	$(shell mkdir -p $@ >/dev/null 2>/dev/null)
+	@echo "Created $@ directory"
+
+$(build_dir):
+	$(shell mkdir -p $@ >/dev/null 2>/dev/null)
+	@echo "Created $@ directory"
+
+$(imported_dir):
+	$(shell mkdir -p $@ >/dev/null 2>/dev/null)
+	@echo "Created $@ directory"
+
+
+clean:
+	$(shell rm -rf $(build_dir))
+	@echo "Remove $(build_dir) directory"
+
+
+info:
+	@echo "root_dir = $(root_dir)"
+	@echo "build_dir = $(build_dir)"
+	@echo "mpss_dir = $(mpss_dir)"
+	@echo "libiomp_host_dir = $(libiomp_host_dir)"
+	@echo "libiomp_target_dir = $(libiomp_target_dir)"
+	@echo "omp_header_dir = $(omp_header_dir)"
+	@echo "os_host = $(os_host)"
+	@echo "os_target = $(os_target)"
+	@echo "compiler_host = $(compiler_host)"
+	@echo "compiler_target = $(compiler_target)"
+	@echo "options_host = $(options_host)"
+	@echo "options_target = $(options_target)"
+

Propchange: openmp/trunk/offload/Makefile
------------------------------------------------------------------------------
    svn:executable = *

Added: openmp/trunk/offload/README.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/offload/README.txt?rev=205909&view=auto
==============================================================================
--- openmp/trunk/offload/README.txt (added)
+++ openmp/trunk/offload/README.txt Wed Apr  9 10:40:23 2014
@@ -0,0 +1,129 @@
+
+	       README for Intel(R) Offload Runtime Library
+	       ===========================================
+
+How to Build Documentation
+==========================
+
+The main documentation is in Doxygen* format, and this distribution
+should come with pre-built PDF documentation in doc/Reference.pdf.
+However, an HTML version can be built by executing:
+
+% doxygen doc/doxygen/config
+
+in this directory.
+
+That will produce HTML documentation in the doc/doxygen/generated
+directory, which can be accessed by pointing a web browser at the
+index.html file there.
+
+If you don't have Doxygen installed, you can download it from
+www.doxygen.org.
+
+
+Software Requirements
+=====================
+
+Intel(R) Offload Runtime Library requires additional software:
+
+1) Intel(R) OpenMP* Runtime Library.  You can either download the source
+code for that (from openmprtl.org or openmp.llvm.org) or simply use the
+compiled version distributed with the Intel compilers.
+2) Intel(R) COI Runtime Library and Intel(R) MYO Runtime Library.  These
+libraries are part of Intel(R) Manycore Platform Software Stack (MPSS).  You
+can download MPSS source code or binaries from
+software.intel.com/en-us/articles/intel-manycore-platform-software-stack-mpss.
+Binaries include host libraries for Intel(R) 64 Architecture and target
+libraries for Intel(R) Many Integrated Core Architecture.
+
+Also you will require all of the libraries that enable the target code to run
+on device.  If you target the Intel(R) Xeon Phi (TM) coprocessor, these
+libraries can be taken from MPSS too.
+
+
+How to Build the Intel(R) Offload Runtime Library
+=================================================
+
+The Makefile at the top-level will attempt to detect what it needs to
+build the Intel(R) Offload Runtime Library.  To see the default settings,
+type:
+
+make info
+
+You can change the Makefile's behavior with the following options:
+
+root_dir:	      The path to the top-level directory containing the
+		      top-level Makefile.  By default, this will take on the
+		      value of the current working directory.
+
+build_dir:	      The path to the build directory.  By default, this will
+		      take on value [root_dir]/build.
+
+mpss_dir:	      The path to the Intel(R) Manycore Platform Software
+		      Stack install directory.  By default, this will take on
+		      the value of operating system's root directory.
+
+libiomp_host_dir:     The path to the host Intel(R) OpenMP* Runtime Library.
+		      This option is required when the host compiler is other
+		      than icc.
+
+libiomp_target_dir:   The path to the target Intel(R) OpenMP* Runtime
+		      Library.  This option is required when the target
+		      compiler is other than icc.
+
+omp_header_dir:       The path to the header file <omp.h> of Intel(R) OpenMP*
+		      Runtime Library.  This option is required if either host
+		      or target compiler is other than icc.
+
+os_host:	      Operating system on host.  Currently supports only
+		      "linux" which is set by default.
+
+os_target:	      Operating system on target device.  Currently supports
+		      only "linux" which is set by default.
+
+compiler_host:	      Which compiler to use for the build of the host part.
+		      Defaults to "gcc"*.  Also supports "icc" and "clang"*.
+		      You should provide the full path to the compiler or it
+		      should be in the user's path.
+
+compiler_host:	      Which compiler to use for the build of the target part.
+		      Defaults to "gcc"*.  Also supports "icc" and "clang"*.
+		      You should provide the full path to the compiler or it
+		      should be in the user's path.
+
+options_host:	      Additional options for the host compiler.
+
+options_target:       Additional options for the target compiler.
+
+To use any of the options above, simple add <option_name>=<value>.  For
+example, if you want to build with icc instead of gcc, type:
+
+make compiler_host=icc compiler_target=icc
+
+
+Supported RTL Build Configurations
+==================================
+
+Supported Architectures: Intel(R) 64, and Intel(R) Many Integrated
+Core Architecture
+
+	      ---------------------------------------------
+	      |   icc/icl     |    gcc      |    clang    |
+--------------|---------------|---------------------------|
+| Linux* OS   |      Yes      |     Yes(1)  |     Yes(1)  |
+| OS X*       |       No      |      No     |      No     |
+| Windows* OS |       No      |      No     |      No     |
+-----------------------------------------------------------
+
+(1) Liboffload requires _rdtsc intrinsic, which may be unsupported by some
+    versions of compiler.  In this case you need to include src/rdtsc.h
+    manually by using Makefile options options_host and options_target:
+
+    make options_host="-include src/rdtsc.h" options_target="-include src/rdtsc.h"
+
+-----------------------------------------------------------------------
+
+Notices
+=======
+
+*Other names and brands may be claimed as the property of others.

Propchange: openmp/trunk/offload/README.txt
------------------------------------------------------------------------------
    svn:executable = *





More information about the Openmp-commits mailing list