Skip to content

Commit

Permalink
Remove Link and GetKernelArgInfo API
Browse files Browse the repository at this point in the history
Change-Id: Ic93651346a96468844798017a043f9e10682e87e
  • Loading branch information
AlexeySotkin authored and AlexeySachkov committed Jan 17, 2019
1 parent b1b5a08 commit e271efb
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 793 deletions.
13 changes: 1 addition & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,11 @@ set(TARGET_NAME ${COMMON_CLANG_LIBRARY_NAME}${BUILD_PLATFORM} )
#
set (COMPILE_OPTIONS_TD opencl_clang_options.td)
set (COMPILE_OPTIONS_INC opencl_clang_options.inc)
set (LINK_OPTIONS_TD opencl_link_options.td)
set (LINK_OPTIONS_INC opencl_link_options.inc)

set(LLVM_TARGET_DEFINITIONS ${COMPILE_OPTIONS_TD})
tablegen(LLVM ${COMPILE_OPTIONS_INC} -gen-opt-parser-defs)
add_public_tablegen_target(CClangCompileOptions)

set(LLVM_TARGET_DEFINITIONS ${LINK_OPTIONS_TD})
tablegen(LLVM ${LINK_OPTIONS_INC} -gen-opt-parser-defs)
add_public_tablegen_target(CClangLinkOptions)

#
# Source code
#
Expand All @@ -141,20 +135,15 @@ set(TARGET_INCLUDE_FILES
binary_result.h
pch_mgr.h
${COMPILE_OPTIONS_TD}
${LINK_OPTIONS_TD}
${COMPILE_OPTIONS_INC}
${LINK_OPTIONS_INC}
)

set(TARGET_SOURCE_FILES
common_clang.cpp
link.cpp
getkernelarginfo.cpp
common_clang.rc
options.cpp
pch_mgr.cpp
options_compile.cpp
options_link.cpp
)

add_definitions( -D__STDC_LIMIT_MACROS )
Expand Down Expand Up @@ -190,7 +179,7 @@ add_library(${TARGET_NAME} SHARED
$<TARGET_OBJECTS:cl_headers>
)

add_dependencies(${TARGET_NAME} CClangLinkOptions CClangCompileOptions)
add_dependencies(${TARGET_NAME} CClangCompileOptions)

install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION bin
Expand Down
4 changes: 4 additions & 0 deletions binary_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Copyright (c) Intel Corporation (2009-2017).
#include "llvm/ADT/SmallVector.h"
#include <string>

// The following #define is taken from
// https://github.com/KhronosGroup/OpenCL-Headers/blob/master/CL/cl.h
#define CL_SUCCESS 0

class OCLFEBinaryResult : public Intel::OpenCL::ClangFE::IOCLFEBinaryResult {
// IOCLFEBinaryResult
public:
Expand Down
7 changes: 6 additions & 1 deletion common_clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ Copyright (c) Intel Corporation (2009-2017).
#include "clang/CodeGen/CodeGenAction.h"
#include "clang/Serialization/ASTReader.h"
#include "clang/Serialization/ModuleManager.h"
#include "CL/cl.h"

// The following #defines are used as return value of Compile() API and defined
// in https://github.com/KhronosGroup/OpenCL-Headers/blob/master/CL/cl.h
#define CL_SUCCESS 0
#define CL_COMPILE_PROGRAM_FAILURE -15
#define CL_OUT_OF_HOST_MEMORY -6

#include "assert.h"
#include <list>
Expand Down
87 changes: 1 addition & 86 deletions common_clang.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Copyright (c) Intel Corporation (2009-2017).
\*****************************************************************************/

#pragma once
#include "CL/cl.h"
#include "assert.h"
#include "cstddef" // size_t

#if defined(_WIN32)
#if defined(COMMON_CLANG_EXPORTS)
Expand Down Expand Up @@ -65,28 +65,6 @@ struct IOCLFEBinaryResult {
protected:
virtual ~IOCLFEBinaryResult() {}
};

//
// GetKernelArgInfo function result structure
//
struct IOCLFEKernelArgInfo {
public:
virtual unsigned int getNumArgs() const = 0;
virtual const char *getArgName(unsigned int index) const = 0;
virtual const char *getArgTypeName(unsigned int index) const = 0;
virtual cl_kernel_arg_address_qualifier
getArgAdressQualifier(unsigned int index) const = 0;
virtual cl_kernel_arg_access_qualifier
getArgAccessQualifier(unsigned int index) const = 0;
virtual cl_kernel_arg_type_qualifier
getArgTypeQualifier(unsigned int index) const = 0;

// release result
virtual void Release() = 0;

protected:
virtual ~IOCLFEKernelArgInfo() {}
};
}
}
}
Expand All @@ -109,24 +87,6 @@ extern "C" CC_DLL_EXPORT bool CheckCompileOptions(
// size of the buffer for unknown options
size_t uiUnknownOptionsSize);

//
// Verifies the given OpenCL application supplied link options
// Params:
// pszOptions - compilation options string
// pszUnknownOptions - optional outbound pointer to the space separated
// unrecognized options
// uiUnknownOptionsSize - size of the pszUnknownOptions buffer
// Returns:
// true if the options verification was successful, false otherwise
//
extern "C" CC_DLL_EXPORT bool CheckLinkOptions(
// A string for compile options
const char *pszOptions,
// buffer to get the list of unknown options
char *pszUnknownOptions,
// size of the buffer for unknown options
size_t uiUnknownOptionsSize);

//
// Compiles the given OpenCL program to the LLVM IR
// Params:
Expand Down Expand Up @@ -167,48 +127,3 @@ extern "C" CC_DLL_EXPORT int Compile(
// optional outbound pointer to the compilation results
Intel::OpenCL::ClangFE::IOCLFEBinaryResult **pBinaryResult);

//
// Links the given OpenCL binaries
// Params:
// pInputHeaders - array of the header buffers
// uiNumInputHeader - size of the pInputHeaders array
// pszInputHeadersNames - array of the headers names
// pPCHBuffer - optional pointer to the pch buffer
// uiPCHBufferSize - size of the pch buffer
// pszOptions - OpenCL application supplied options
// pszOptionsEx - optional extra options string usually supplied by runtime
// pszDeviceSupportedExtentions - space separated list of the supported
// OpenCL extensions string
// pszOpenCLVer - OpenCL version string - "120" for OpenCL 1.2, "200" for
// OpenCL 2.0, ...
// pBinaryResult - optional outbound pointer to the compilation results
// Returns:
// Link Result as int: 0 - success, error otherwise.
//
extern "C" CC_DLL_EXPORT int Link(
// array of additional input headers to be passed in memory
const void **pInputBinaries,
// the number of input binaries
unsigned int uiNumBinaries,
// the size in bytes of each binary
const size_t *puiBinariesSizes,
// OpenCL application supplied options
const char *pszOptions,
// optional outbound pointer to the compilation results
Intel::OpenCL::ClangFE::IOCLFEBinaryResult **pBinaryResult);

//
// Gets the kernel argument information for the specific kernel
// Params:
// pBin - pointer to the binary to query
// uiBinarySize - size of the binary pointed by pBin
// szKernelName - name of the kernel to query the info about
// ppResult - pointer to the result structure - allocated by function
// client should call Release method to free the memory
// Returns:
// Link Result as int: 0 - success, error otherwise.
//
extern "C" CC_DLL_EXPORT int
GetKernelArgInfo(const void *pBin, size_t uiBinarySize,
const char *szKernelName,
Intel::OpenCL::ClangFE::IOCLFEKernelArgInfo **ppResult);
206 changes: 0 additions & 206 deletions getkernelarginfo.cpp

This file was deleted.

Loading

0 comments on commit e271efb

Please sign in to comment.