[Beignet] [PATCH 6/6] Implement printf for new runtime.

2017-06-23 Thread junyan . he
From: Junyan He <junyan...@intel.com> We will store printf statement in ELF file and output its log when the ND_Range finished. Signed-off-by: Junyan He <junyan...@intel.com> --- backend/src/backend/gen_program_elf.cpp | 47 ++- backend/src/backend/program.hpp | 6 +- ba

[Beignet] [PATCH 5/6] Fix get kernel_names bug.

2017-06-23 Thread junyan . he
From: Junyan He <junyan...@intel.com> The cl_program_get_kernel_names should use size_t rather than int. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_api_program.c | 5 +++-- runtime/cl_program.c | 2 +- runtime/cl_program.h | 2 +- 3 files changed, 5 inse

[Beignet] [PATCH 4/6] FIx get kernel arg info crash bug.

2017-06-23 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- backend/src/llvm/llvm_gen_backend.cpp | 5 +++-- backend/src/llvm/llvm_passes.cpp | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/src/llvm/llvm_gen_ba

[Beignet] [PATCH 1/6] GBE: make compiler_api.cpp work for LLVM40

2017-06-23 Thread junyan . he
From: Ruiling Song And LLVM40 changed some api, so we need to update this file. Also we have refined the llvm version check. Signed-off-by: Ruiling Song --- backend/src/backend/compiler_api.cpp | 57 +++- 1 file

[Beignet] [PATCH 3/6] Set the triple to correct default value if SPIR and SPIR64

2017-06-23 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- backend/src/backend/compiler_api.cpp | 19 +++ 1 file changed, 19 insertions(+) diff --git a/backend/src/backend/compiler_api.cpp b/backend/src/backend/compiler_api.cpp i

[Beignet] [PATCH 2/6] runtime: some backend don't use block_ip.

2017-06-23 Thread junyan . he
From: Ruiling Song Signed-off-by: Ruiling Song --- runtime/gen/cl_command_queue_gen.c | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/gen/cl_command_queue_gen.c b/runtime/gen/cl_command_queue_gen.c index 4c18a52..0cb19f9 100644 ---

[Beignet] [PATCH 57/57 V2] Modify CMakeList.txt to enable new runtime.

2017-06-23 Thread junyan . he
From: Junyan He <junyan...@intel.com> We default set NEW_RUNTIME option off. And can enable it be set -DNEW_RUNTIME=1 V2: Fix build error for internal kernel. Signed-off-by: Junyan He <junyan...@intel.com> Signed-off-by: Ruiling Song <ruiling.s...@intel.com> -

[Beignet] [PATCH 52/57] Add cl_device_id_gen to define cl_device_id for GEN.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> The cl_device_enqueue_gen derive from the cl_device_id and it represents one OpenCL device for cl_device_id. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/cl_device_id_gen.c | 1015 1

[Beignet] [PATCH 56/57] Add git sha generator.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> We add git repo info for each beignet runtime building. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/git_sha1.sh | 20 1 file changed, 20 insertions(+) create mode 100755 runtime/git_sha1.sh diff --git a/runt

[Beignet] [PATCH 54/57] Add all internal kernels for GEN device.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Add these kernels are used as builtin kernels. They also help to do some clEnqueueXXX job such as mem_copy, image_fill, etc. Signed-off-by: Junyan He <junyan...@intel.com> --- .../cl_internal_block_motion_estimate_intel.

[Beignet] [PATCH 53/57] Add cl_compiler_gen to use compiler backend.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> cl_compiler_gen can find the compiler backend and load it using dlopen function. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/cl_compiler_gen.c | 94 +++ 1 file changed, 94 insertions(+)

[Beignet] [PATCH 57/57] Modify CMakeList.txt to enable new runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> We default set NEW_RUNTIME option off. And can enable it be set -DNEW_RUNTIME=1 --- CMakeLists.txt | 16 +- backend/CMakeLists.txt | 1 + backend/src/CMakeLists.txt | 1 + runtime/CMakeLists.txt

[Beignet] [PATCH 55/57] Add binary generator for runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> We need some builtin kernel to handle some task. We need to binary format to save the program building time. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/kernels/gen_bin_generater.c | 301 1

[Beignet] [PATCH 48/57] Add cl_command_queue_gen to implement cl_command_queue for GEN.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/cl_command_queue_gen.c | 1721 1 file changed, 1721 insertions(+) create mode 100644 runtime/gen/cl_command_queue_gen.c diff --git a

[Beignet] [PATCH 45/57] Add cl_mem_gen to implement cl_men for GEN device.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/cl_mem_gen.c | 1269 ++ 1 file changed, 1269 insertions(+) create mode 100644 runtime/gen/cl_mem_gen.c diff --git a/runtime/gen/cl

[Beignet] [PATCH 51/57] Add GEN device's image functions to cl_image_gen.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/cl_image_gen.c | 1247 1 file changed, 1247 insertions(+) create mode 100644 runtime/gen/cl_image_gen.c diff --git a/runtime/gen/cl_i

[Beignet] [PATCH 47/57] Add cl_context_gen to create cl_context.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> cl_context_gen use intel_driver to create GEN GPU's specific context. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/cl_context_gen.c | 188 +++ 1 file changed, 188 insertions(+) create

[Beignet] [PATCH 46/57] Add cl_kernel_gen for GEN device's kernel.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> cl_kernel_gen uses cl_program_gen's information to create cl_kernel for GEN specific. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/cl_kernel_gen.c | 583 1 file changed, 58

[Beignet] [PATCH 50/57] Implement cl_event_gen for cl_event.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/cl_event_gen.c | 105 + 1 file changed, 105 insertions(+) create mode 100644 runtime/gen/cl_event_gen.c diff --git a/runtime/gen/cl_e

[Beignet] [PATCH 44/57] Add cl_program_gen.c to parse GEN's ELF format file.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> The compiler backend will generate standard ELF format file or memory image for GEN's binary. The cl_program_gen need to parse it and generate cl_program. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/cl_program

[Beignet] [PATCH 32/57] Implement all kernel related API in cl_api_kernel.c

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_api_kernel.c | 517 1 file changed, 517 insertions(+) create mode 100644 runtime/cl_api_kernel.c diff --git a/runtime/cl_api_kernel

[Beignet] [PATCH 43/57] Add intel_defines.h file to define command format.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> This file contains all defines for GPU command. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/intel_defines.h | 352 1 file changed, 352 insertions(+) create mode 100644

[Beignet] [PATCH 38/57] Add intel_batch buffer implementation to GEN device.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> The batch buffer is used to sent GPU command to GEN device. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/intel_batchbuffer.c | 228 runtime/gen/intel_batchbu

[Beignet] [PATCH 36/57] Add device define for different generation of GEN GPU.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/cl_gen75_device.h | 30 ++ runtime/gen/cl_gen7_device.h | 34 ++ runtime/gen/cl_gen8_de

[Beignet] [PATCH 42/57] Add intel_structs.h file to define GEN's configure format.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> This file contains all configure format for GEN device, such as surface BTI, sampler and image format. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/intel_structs.h | 809 1 file

[Beignet] [PATCH 40/57] Add intel driver to handle the gen device setting.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> One cl_context should have one of this struct to handle the GPU context setting and configuration. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/intel_driver.c | 913 + runtime/gen/in

[Beignet] [PATCH 34/57] Add X11 support to gen device related dir.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Gen device need to use dri to get information if XServer is available. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/x11/dricommon.c | 328 runtime/gen/x11/dricommon

[Beignet] [PATCH 35/57] Add cl_gen_device_common.h to define common field for gen device.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> This file define all common fields for Intel's GEN GPU device. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/cl_gen_device_common.h | 126 + 1 file changed, 126 insertions(+) create mode 10

[Beignet] [PATCH 37/57] Add cl_gen.h to gen device.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> This file defines all specific struct used by gen device. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/cl_gen.h | 378 +++ 1 file changed, 378 insertions(+) create mode 100644

[Beignet] [PATCH 41/57] Add gen device pci id define and macro to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> We need to recognize all gen device by its pci id. We also need some macro to help get the gen version based on pci id. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/gen_device_pci_id.h | 365

[Beignet] [PATCH 31/57] Implement all sampler related API in cl_api_sampler.c

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_api_sampler.c | 202 +++ 1 file changed, 202 insertions(+) create mode 100644 runtime/cl_api_sampler.c diff --git a/runtime/cl_api_sampler

[Beignet] [PATCH 33/57] Implement all device related API in cl_api_device_id.c

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_api_device_id.c | 90 ++ 1 file changed, 90 insertions(+) create mode 100644 runtime/cl_api_device_id.c diff --git a/runtime/cl_api_d

[Beignet] [PATCH 39/57] Add GEN device's GPGPU helper functions.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Add all useful functions for GEN device setting, e.g, BTI setting, sampler status and image parameters. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/gen/gen_gpgpu_func.c | 1864 ++ 1 file c

[Beignet] [PATCH 30/57] Implement all program related API in cl_api_program.c

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_api_program.c | 632 +++ 1 file changed, 632 insertions(+) create mode 100644 runtime/cl_api_program.c diff --git a/runtime/cl_api_program

[Beignet] [PATCH 29/57] Implement all mem related API in cl_api_mem.c

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_api_mem.c | 3499 ++ 1 file changed, 3499 insertions(+) create mode 100644 runtime/cl_api_mem.c diff --git a/runtime/cl_api_mem

[Beignet] [PATCH 28/57] Implement all event related API in cl_api_event.c

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_api_event.c | 352 + 1 file changed, 352 insertions(+) create mode 100644 runtime/cl_api_event.c diff --git a/runtime/cl_api_event

[Beignet] [PATCH 20/57] Add cl_sampler define to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_sampler.c | 133 +++ runtime/cl_sampler.h | 57 ++ 2 files changed, 190 insertions(+) create mode 100644 runtime/

[Beignet] [PATCH 27/57] Implement all command queue related API in cl_api_command_queue.c

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_api_command_queue.c | 233 + 1 file changed, 233 insertions(+) create mode 100644 runtime/cl_api_command_queue.c diff --g

[Beignet] [PATCH 21/57] Add cl_event define to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> cl_event struct is important in runtime. Each clEnqueueXXX like api will generate one cl_event, if the event can be executed immediately, we exec it sync by calling the according device_api's function. If not, we will store it in the command queue's

[Beignet] [PATCH 24/57] Add khr_icd define to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_khr_icd.c | 194 +++ runtime/cl_khr_icd.h | 32 + 2 files changed, 226 insertions(+) create mode 100644 runtime/cl_khr_icd.c

[Beignet] [PATCH 25/57] Implement all platform related API in cl_api_platform_id.c

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_api_platform_id.c | 101 +++ 1 file changed, 101 insertions(+) create mode 100644 runtime/cl_api_platform_id.c diff --git a/runtime/cl_api_pla

[Beignet] [PATCH 23/57] Add cl_enqueue to handle all clEnqueueXXX API.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> All clEnqueueXXX API will generate a cl_event and set the exec_data correctly. The cl_enqueue_handle function will call the real function in device_api to do the real job, when all events it depends on are completed. Signed-off-by: Junyan He &

[Beignet] [PATCH 17/57] Add image common logic to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> The cl_image will handle common logic for image of Intel platform. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_image.c | 192 + runtime/cl_image.h | 35 ++ 2 files

[Beignet] [PATCH 26/57] Implement all context related API in cl_api_context.c

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_api_context.c | 174 +++ 1 file changed, 174 insertions(+) create mode 100644 runtime/cl_api_context.c diff --git a/runtime/cl_api_context

[Beignet] [PATCH 18/57] Add extension support to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> The intel platform will provide a basic extension, all devices on this platform need to support these extensions. Each device can add some extension based on the device capability and configuration if needed. Signed-off-by: Junyan He <junyan...@

[Beignet] [PATCH 16/57] Implement mem related cl object logic.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> The cl_mem.c will handle all common logic of OpenCL mem object. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_mem.c | 1258 ++ 1 file changed, 1258 insertions(+) create mode 10

[Beignet] [PATCH 05/57] Add compiler API functions.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> We will split the compiler with runtime. The runtime will call the compiler using standard Build, Compile, and Link API to generate ELF, IR Bitcode. The file implements all these APIs. Signed-off-by: Junyan He <junyan...@intel.com> ---

[Beignet] [PATCH 08/57] Add base object file to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> The cl_base_object will be the base class for all cl runtime objects such as cl_mem, cl_kernel, cl_program. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_base_object.c | 176

[Beignet] [PATCH 15/57] Add cl_mem define to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> We define cl_mem as the base class for all mem related CL object. cl_image, cl_buffer, cl_pipe and cl_mem_svm derive from it. Also define a lot of macro for mem usage. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl

[Beignet] [PATCH 13/57] Add cl_context define to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_context.c | 436 +++ runtime/cl_context.h | 105 + 2 files changed, 541 insertions(+) create mode 100644 runtime/cl_conte

[Beignet] [PATCH 07/57] Add all utility helper functions to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_utils.c | 125 runtime/cl_utils.h | 207 + 2 files changed, 332 insertions(+) create mode 10

[Beignet] [PATCH 14/57] Add cl_command_queue define to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> We create a worker thread in command queue to handle the event requirement. Each equeueXXX api will generate a enqueue event, and will be add to exec list in command queue worker thread. Signed-off-by: Junyan He <junyan...@intel.com>

[Beignet] [PATCH 11/57] Add cl_platform define in runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> We define intel_platform the default and only one platform id for runtime. We only support intel platform in beignet. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_platform_id.c | 113

[Beignet] [PATCH 10/57] Add compiler API to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> The cl_compiler define common APIs for backend compiler. The OpencL build, compile and link API will call these APIs to generate the binary. This is also useful when wen need to unload the compiler. Signed-off-by: Junyan He <junyan...@intel.com>

[Beignet] [PATCH 12/57] Add device id define to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> The device cl_device_id define the common content for all kinds of OpenCL device implementation. Every kind of device can derive this struct. Signed-off-by: Junyan He <junyan...@intel.com> --- runtime/cl_devic

[Beignet] [PATCH 03/57] Add a mem stream class to support ELF write.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Elf writer need to make sure seekp function work, while sstream fails it. Implement wmemstreambuf to support mem ostream which can support seek out of the range. Signed-off-by: Junyan He <junyan...@intel.com> Reviewed-by: Yang Rong <rong.r

[Beignet] [PATCH 09/57] Add cl_device_api to runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> The cl_device_api plays a very important role in defining device relative API. Every kind of device has its own logic to handle the CL API, e.g., the clEnqueueNDRangeKernel will call the device_api->enqueue_kernel function to do the real job. S

[Beignet] [PATCH 06/57] Add cl_alloc.h for new runtime.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> Define malloc and calloc for debuging. We can enable CL_ALLOC_DEBUG to find memory leak points in CL runtime. All the mem alloc operations in runtime need to use these macro rather than direct call the system alloc functions. Signed-off-by: Junyan He &

[Beignet] [PATCH 04/57] Add GenProgram::toBinaryFormat to generate ELF format binary.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> We add this function to generate a standard ELF format binary. All the verbose information we need in runtime will be stored in .note.gpu_info section. Then, we can separate the runtime and compiler clearly. V2: Add OpenCL info such as Argumen

[Beignet] [PATCH 02/57] Modify the elfio lib, make it generate memory image.

2017-06-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> We do not want to write the elf binary directly to a file. We prefer to keep it in the memory and analyse the elf image in runtime. Signed-off-by: Junyan He <junyan...@intel.com> Reviewed-by: Yang Rong <rong.r.y...@intel.com> --- backend/s

[Beignet] [PATCH] Fix bugs about 2.0 pipe.

2017-04-10 Thread junyan . he
From: Junyan He <junyan...@intel.com> Fix somes bugs of compiler and runtime, make 2.0's pipe work. Signed-off-by: Junyan He <junyan...@intel.com> --- backend/src/backend/context.cpp | 3 +- backend/src/backend/gen_program_elf.cpp | 8 -

[Beignet] [PATCH newRT] Add relocation table for ELF file to support 2.0

2017-04-10 Thread junyan . he
From: Junyan He <junyan...@intel.com> 2.0 Spec require a global memory and the global pointer can point to any global variable. We add a rela.rodata section in ELF file to support the relocation. The global memory just available for 2.0 later. Signed-off-by: Junyan He <junyan...@

[Beignet] [PATCH 1/9 newRT] Add cl_gen_device_common.h file.

2017-04-01 Thread junyan . he
From: Junyan He <junyan...@intel.com> This file will implement all gen device common fields. Signed-off-by: Junyan He <junyan...@intel.com> --- src/gen/cl_gen_device_common.h | 118 + 1 file changed, 118 insertions(+) create mode 10

[Beignet] [PATCH 3/9 newRT] Refine intel batch buffer.

2017-04-01 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- src/gen/intel_batchbuffer.c | 104 ++-- src/gen/intel_batchbuffer.h | 14 +++--- 2 files changed, 78 insertions(+), 40 deletions(-) diff --g

[Beignet] [PATCH 8/9 newRT] Move event profiling exec time function to gen dir

2017-04-01 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- src/CMakeLists.txt | 1 + src/cl_event.c | 52 ++- src/gen/cl_event_gen.c | 74 ++ 3 files changed, 7

[Beignet] [PATCH 9/9 newRT] Make the memory leak tracker work.

2017-04-01 Thread junyan . he
From: Junyan He <junyan...@intel.com> User can easily disable/enable the macro CL_ALLOC_DEBUG in cl_alloc.h to find the leak points within the cl runtime lib. Signed-off-by: Junyan He <junyan...@intel.com> --- src/cl_alloc.c | 1 + src/cl_platform_id.c | 3 +++ 2 file

[Beignet] [PATCH 5/9 newRT] Add compiler API functions.

2017-04-01 Thread junyan . he
From: Junyan He <junyan...@intel.com> We will split the compiler with runtime. The runtime will call the compiler using standard Build, Compile, and Link API to generate ELF, IR Bitcode. The file implements all these APIs Signed-off-by: Junyan He <junyan...@intel.com> --- CM

[Beignet] [PATCH 2/9 newRT] Move pci id for gen to gen dir.

2017-04-01 Thread junyan . he
From: Junyan He <junyan...@intel.com> Move the logic for recognizing the gen device's pci id to gen dir and rename it to gen_device_pci_id.h. Signed-off-by: Junyan He <junyan...@intel.com> --- src/gen/gen_device_pci_id.h | 365 1 file

[Beignet] [PATCH 6/9 newRT] Add GenProgram::toBinaryFormat to generate ELF format binary.

2017-04-01 Thread junyan . he
From: Junyan He <junyan...@intel.com> We add this function to generate a standard ELF format binary. All the verbose information we need in runtime will be stored in .note.gpu_info section. Then, we can separate the runtime and compiler clearly. V2: Add OpenCL info such as Argumen

[Beignet] [PATCH newRT] Move pci id for gen to gen dir.

2017-03-28 Thread junyan . he
From: Junyan He <junyan...@intel.com> Move the logic for recognizing the gen device's pci id to gen dir and rename it to gen_device_pci_id.h. Signed-off-by: Junyan He <junyan...@intel.com> --- src/gen/gen_device_pci_id.h | 365 1 file

[Beignet] [PATCH newRT] Add cl_gen_device_common.h file.

2017-03-28 Thread junyan . he
From: Junyan He <junyan...@intel.com> This file will implement all gen device common fields. Signed-off-by: Junyan He <junyan...@intel.com> --- src/gen/cl_gen_device_common.h | 118 + 1 file changed, 118 insertions(+) create mode 10

[Beignet] [PATCH 1/6 newRT] Refine intel_driver file.

2017-03-28 Thread junyan . he
From: Junyan He <junyan...@intel.com> Delete some verbose logic and make create/delete the only API for creating and destroy the intel_driver. Signed-off-by: Junyan He <junyan...@intel.com> --- src/gen/intel_driver.c | 734 --

[Beignet] [PATCH 6/6 newRT] Add cl_context_gen file.

2017-03-28 Thread junyan . he
From: Junyan He <junyan...@intel.com> This file will implement all the logic specific to GEN. Signed-off-by: Junyan He <junyan...@intel.com> --- src/gen/cl_context_gen.c | 195 +++ src/gen/cl_gen.h | 55 + 2 files

[Beignet] [PATCH 3/6 newRT] Fix two bugs in gen kernel.

2017-03-28 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- src/gen/cl_kernel_gen.c | 2 +- src/gen/cl_program_gen.c | 6 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gen/cl_kernel_gen.c b/src/gen/cl_kernel_gen.c index 78ce

[Beignet] [PATCH 4/6 newRT] Add cl_device_id_gen file in gen dir.

2017-03-28 Thread junyan . he
From: Junyan He <junyan...@intel.com> This file will implement all device_id related logic. After inited, it will create a static GEN device for later usage. Signed-off-by: Junyan He <junyan...@intel.com> --- src/gen/cl_device_id_gen.c | 974 ++

[Beignet] [PATCH 2/6 newRT] Move X11 files to gen dir.

2017-03-28 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- src/CMakeLists.txt | 4 +- src/gen/x11/dricommon.c | 333 src/gen/x11/dricommon.h | 99 + src/gen/x11/va_dri2.c

[Beignet] [PATCH newRT] Move intel_driver.c to gen dir and format its style.

2017-03-23 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- src/CMakeLists.txt |2 +- src/cl_driver.cpp |2 +- src/gen/intel_batchbuffer.c |2 +- src/gen/intel_driver.c | 1058

[Beignet] [PATCH newRT] Move intel_structs.h to gen dir and format its style.

2017-03-23 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- src/gen/intel_structs.h | 816 + src/intel/intel_gpgpu.c | 2 +- src/intel/intel_structs.h | 832 ---

[Beignet] [PATCH newRT] Move intel's batch buffer souce code to gen dir.

2017-03-23 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- src/CMakeLists.txt| 2 +- src/cl_image.c| 2 +- src/gen/intel_batchbuffer.c | 189 +++ src/gen/intel_batchbuffer.h | 151 +++

[Beignet] [PATCH newRT] Fix some resource leak point in utests.

2017-03-23 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- utests/compiler_copy_image_1d.cpp | 1 + utests/enqueue_built_in_kernels.cpp | 1 + utests/sub_buffer.cpp | 2 +- utests/vload_bench.cpp | 2 ++ 4 files changed,

[Beignet] [PATCH newRT] Wrap all memory allocate functions.

2017-03-23 Thread junyan . he
From: Junyan He <junyan...@intel.com> We modify all memory allocated functions in cl_alloc file, make it easy to debug all the memory leak point. Signed-off-by: Junyan He <junyan...@intel.com> --- src/cl_accelerator_intel.c | 4 +- src/cl_alloc.c

[Beignet] [PATCH] Refine command queue's enqueue ndrang.

2017-03-02 Thread junyan . he
From: Junyan He <junyan...@intel.com> Delete all the obsolete code in command_queue_gen7.c Make the code logic more clean and using the elf info to do the job. After that, we can total split the GBE backend from the runtime. We do not need to get the kernel info from GBE backend at r

[Beignet] [PATCH] Move compiler load/unload logic to gen specific file.

2017-03-02 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- src/cl_compiler.c | 77 +- src/gen/cl_compiler_gen.c | 95 +++ 2 files changed, 96 insertions(+),

[Beignet] [PATCH] Move intel_gpgpu.c's functions to new file.

2017-03-02 Thread junyan . he
From: Junyan He <junyan...@intel.com> The gpgpu struct will be re-define. All the global function pointers are deleted and the funtions need to use new gpgpu struct pointer as parameter. Signed-off-by: Junyan He <junyan...@intel.com> --- src/gen/gen_gpgpu_f

[Beignet] [PATCH] Add libelf check in CMakeList

2017-03-02 Thread junyan . he
From: Junyan He <junyan...@intel.com> We need the libelf support to parse the binary files generated by GBE backend from now on. Signed-off-by: Junyan He <junyan...@intel.com> --- CMakeLists.txt | 8 src/CMakeLists.txt | 1 + 2 files changed, 9 insertions(+)

[Beignet] [PATCH V2 newRT] Add compiler API functions.

2017-03-02 Thread junyan . he
From: Junyan He <junyan...@intel.com> We will split the compiler with runtime. The runtime will call the compiler using standard Build, Compile, and Link API to generate ELF, IR Bitcode. The file implements all these APIs. V2: Add check option for gbe. Fix some bugs. Signed-off-by: Jun

[Beignet] [PATCH V4 newRT] Add GenProgram::toBinaryFormat to generate ELF format binary.

2017-03-02 Thread junyan . he
From: Junyan He <junyan...@intel.com> We add this function to generate a standard ELF format binary. All the verbose information we need in runtime will be stored in .note.gpu_info section. Then, we can separate the runtime and compiler clearly. V2: Add OpenCL info such as Argumen

[Beignet] [PATCH V3 newRT] Add GenProgram::toBinaryFormat to generate ELF format binary.

2017-03-02 Thread junyan . he
From: Junyan He <junyan...@intel.com> We add this function to generate a standard ELF format binary. All the verbose information we need in runtime will be stored in .note.gpu_info section. Then, we can separate the runtime and compiler clearly. V2: Add OpenCL info such as Argumen

[Beignet] [PATCH 1/2] Add compiler API functions.

2017-02-23 Thread junyan . he
From: Junyan He <junyan...@intel.com> We will split the compiler with runtime. The runtime will call the compiler using standard Build, Compile, and Link API to generate ELF, IR Bitcode. The file implements all these APIs V2: Add LLVM 3.5 support Signed-off-by: Junyan He <junyan...@

[Beignet] [PATCH 2/2] Add GenProgram::toBinaryFormat to generate ELF format binary.

2017-02-23 Thread junyan . he
From: Junyan He <junyan...@intel.com> We add this function to generate a standard ELF format binary. All the verbose information we need in runtime will be stored in .note.gpu_info section. Then, we can separate the runtime and compiler clearly. V2: Add OpenCL info such as Argumen

[Beignet] [PATCH] Add cl_compiler struct.

2017-02-12 Thread junyan . he
From: Junyan He <junyan...@intel.com> This struct will play a important role to call the build/compile APIs provided by backend compiler. And can implement the unload compiler API of CL spec. Signed-off-by: Junyan He <junyan...@intel.com> --- src/cl_comp

[Beignet] [PATCH] Add compiler API functions.

2017-02-12 Thread junyan . he
From: Junyan He <junyan...@intel.com> We will split the compiler with runtime. The runtime will call the compiler using standard Build, Compile, and Link API to generate ELF, IR Bitcode. The file implements all these APIs Signed-off-by: Junyan He <junyan...@intel.com> --- backend

[Beignet] [PATCH 3/4] Add a mem stream class to support ELF write.

2017-02-08 Thread junyan . he
From: Junyan He <junyan...@intel.com> Elf writer need to make sure seekp function work, while sstream fails it. Implement wmemstreambuf to support mem ostream which can support seek out of the range. Signed-off-by: Junyan He <junyan...@intel.com> --- backend/src/CM

[Beignet] [PATCH 2/4] Modify the elfio lib, make it generate memory image.

2017-02-08 Thread junyan . he
From: Junyan He <junyan...@intel.com> We do not want to write the elf binary directly to a file. We prefer to keep it in the memory and analyse the elf image in runtime. Signed-off-by: Junyan He <junyan...@intel.com> --- backend/src/elfio/elfio.hpp

[Beignet] [PATCH 4/4] Add GenProgram::toBinaryFormat to generate ELF format binary.

2017-02-08 Thread junyan . he
From: Junyan He <junyan...@intel.com> We add this function to generate a standard ELF format binary. All the verbose information we need in runtime will be stored in .note.gpu_info section. Then, we can separate the runtime and compiler clearly. Signed-off-by: Junyan He <junyan...@

[Beignet] [PATCH] Fix two bugs about command queue destroy.

2017-01-11 Thread junyan . he
From: Junyan He <junyan...@intel.com> 1. Call finish before we destroy the command queue. We should make sure all the commands in the queue are finished before we really destroy the command_queue. If not, may cause event status error. We leave the queue's life time to user

[Beignet] [PATCH] Fix a event notify bug.

2017-01-05 Thread junyan . he
From: Junyan He <junyan...@intel.com> When a event complete, we need to notify all the command_queue within the same context. But sometime, some command_queue in the context is already invalid. Modify to ensure all the command_queue to be notified are valid. Signed-off-by: Junyan He &

[Beignet] [PATCH] Fix two bugs about event.

2017-01-04 Thread junyan . he
From: Junyan He <junyan...@intel.com> 1. NDrangeKernel need to call cl_event_exec every time. 2. Enqueue Barrier event need to add to queue every time. Signed-off-by: Junyan He <junyan...@intel.com> --- src/cl_api_event.c | 1 + src/cl_api_kernel.c | 28 -

[Beignet] [PATCH] Improve event execute function.

2016-12-27 Thread junyan . he
From: Junyan He <junyan...@intel.com> Modify the event exec function, make it as the uniformal entry for all event command execution. This will help the timestamp record and profiling feature a lot. V2: 1. Set event init state to bigger than CL_QUEUED. Event state should be set to CL_

[Beignet] [PATCH] Utest: Refine half and float convert functions.

2016-12-26 Thread junyan . he
From: Junyan He <junyan...@intel.com> Signed-off-by: Junyan He <junyan...@intel.com> --- utests/utest_helper.cpp | 171 +--- 1 file changed, 90 insertions(+), 81 deletions(-) diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp i

  1   2   3   4   5   6   >