Commit 39ba247d by John Plate Committed by Commit Bot

Remove redundant OpenCL ICD library

Removed redundant OpenCL ICD library, using regular OpenCL library instead. Bug: angleproject:5908 Change-Id: I1ecf5347557106511aed3c5c4a4bfa35590a559a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2877240Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: John Plate <jplate@google.com>
parent abab4739
...@@ -23,7 +23,7 @@ config("angle_cl_backend_config") { ...@@ -23,7 +23,7 @@ config("angle_cl_backend_config") {
angle_source_set("angle_cl_backend") { angle_source_set("angle_cl_backend") {
sources = _cl_backend_sources sources = _cl_backend_sources
configs += [ "$angle_root/src/libOpenCL:opencl_icd_library_name" ] configs += [ "$angle_root/src/libOpenCL:opencl_library_name" ]
public_deps = [ public_deps = [
"$angle_root:libANGLE_headers", "$angle_root:libANGLE_headers",
......
...@@ -48,16 +48,16 @@ CLPlatformCL::ImplList CLPlatformCL::GetPlatforms(bool isIcd) ...@@ -48,16 +48,16 @@ CLPlatformCL::ImplList CLPlatformCL::GetPlatforms(bool isIcd)
if (khrIcdVendors == nullptr) if (khrIcdVendors == nullptr)
{ {
// Our OpenCL entry points are not reentrant, so we have to prevent khrIcdInitialize() // Our OpenCL entry points are not reentrant, so we have to prevent khrIcdInitialize()
// from querying ANGLE's OpenCL ICD library. We store a dummy entry with the library in // from querying ANGLE's OpenCL library. We store a dummy entry with the library in the
// the khrIcdVendors list, because the ICD Loader skips the libries which are already in // khrIcdVendors list, because the ICD Loader skips the libraries which are already in
// the list as it assumes they were already enumerated. // the list as it assumes they were already enumerated.
static angle::base::NoDestructor<KHRicdVendor> sVendorAngle({}); static angle::base::NoDestructor<KHRicdVendor> sVendorAngle({});
sVendorAngle->library = khrIcdOsLibraryLoad(ANGLE_OPENCL_ICD_LIB_NAME); sVendorAngle->library = khrIcdOsLibraryLoad(ANGLE_OPENCL_LIB_NAME);
khrIcdVendors = sVendorAngle.get(); khrIcdVendors = sVendorAngle.get();
if (khrIcdVendors->library != nullptr) if (khrIcdVendors->library != nullptr)
{ {
khrIcdInitialize(); khrIcdInitialize();
// After the enumeration we don't need ANGLE's OpenCL ICD library any more, // After the enumeration we don't need ANGLE's OpenCL library any more,
// but we keep the dummy entry int the list to prevent another enumeration. // but we keep the dummy entry int the list to prevent another enumeration.
khrIcdOsLibraryUnload(khrIcdVendors->library); khrIcdOsLibraryUnload(khrIcdVendors->library);
khrIcdVendors->library = nullptr; khrIcdVendors->library = nullptr;
......
...@@ -8,43 +8,23 @@ import("../../gni/angle.gni") ...@@ -8,43 +8,23 @@ import("../../gni/angle.gni")
assert(angle_enable_cl) assert(angle_enable_cl)
angle_shared_library("OpenCL_ANGLE") { cl_library_name = "OpenCL_ANGLE"
defines = [ "LIBCL_IMPLEMENTATION" ]
sources = [ config("opencl_library_name") {
"dispatch.cpp",
"dispatch.h",
"libOpenCL_autogen.cpp",
]
configs += [
"$angle_root:debug_annotations_config",
"$angle_root:library_name_config",
]
deps = [
"$angle_root:angle_common",
"$angle_root:cl_includes",
]
}
icd_library_name = "OpenCL_ICD_ANGLE"
config("opencl_icd_library_name") {
if (is_win) { if (is_win) {
defines = [ "ANGLE_OPENCL_ICD_LIB_NAME=\"" + icd_library_name + "\"" ] defines = [ "ANGLE_OPENCL_LIB_NAME=\"" + cl_library_name + "\"" ]
} else { } else {
defines = [ "ANGLE_OPENCL_ICD_LIB_NAME=\"lib" + icd_library_name + ".so\"" ] defines = [ "ANGLE_OPENCL_LIB_NAME=\"lib" + cl_library_name + ".so\"" ]
} }
} }
angle_shared_library(icd_library_name) { angle_shared_library(cl_library_name) {
defines = [ "LIBCL_IMPLEMENTATION" ] defines = [ "LIBCL_IMPLEMENTATION" ]
sources = [ sources = [
"dispatch.cpp", "dispatch.cpp",
"dispatch.h", "dispatch.h",
"libOpenCL_ICD.cpp", "libOpenCL_autogen.cpp",
] ]
configs += [ configs += [
...@@ -59,8 +39,5 @@ angle_shared_library(icd_library_name) { ...@@ -59,8 +39,5 @@ angle_shared_library(icd_library_name) {
} }
group("angle_cl") { group("angle_cl") {
data_deps = [ data_deps = [ ":$cl_library_name" ]
":OpenCL_ANGLE",
":OpenCL_ICD_ANGLE",
]
} }
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// libOpenCL_ICD.cpp: Implements the CL entry point required for extension cl_khr_icd.
#include "libOpenCL/dispatch.h"
extern "C" {
void *CL_API_CALL clGetExtensionFunctionAddress(const char *func_name)
{
return cl::GetDispatch().clGetExtensionFunctionAddress(func_name);
}
} // extern "C"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment