OpenCL-based SCA component heterogeneous parallel loading scheduling method
Through the heterogeneous parallel loading scheduling method of SCA components based on OpenCL, the configuration file is parsed to obtain the OpenCL component loading parameters and match the best heterogeneous devices, which solves the problem of low operation efficiency of SCA components on heterogeneous devices, and achieves efficient component loading and performance improvement.
Patent Information
- Application Number
- CN202411985318.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The operation efficiency of SCA components on heterogeneous devices is low and lacks fine-grained resource scheduling methods, making it difficult to meet the parallel scheduling needs of future waveform intelligent algorithm modules.
Using the OpenCL-based SCA component heterogeneous parallel loading scheduling method, the component's OpenCL component loading parameters are obtained by analyzing the waveform SAD and PRF configuration files, matching the optimal heterogeneous loading device, and using the OpenCL API to compile the kernel and load binary code, directly deploying the components to the matching device.
It improves the loading efficiency and performance of SCA components, enhances device adaptability and operation efficiency, makes full use of heterogeneous computing resources, and solves the problem of insufficient device loading capacity.
Smart Images

Figure CN119759452A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and more specifically, to an OpenCL-based SCA component heterogeneous parallel loading scheduling method. Background Art
[0002] Software radio technology builds an open, standardized, modular unified architecture platform, loads waveform software such as communication system, data format, encryption mode, network protocol, etc. to a general hardware platform to realize the functions of wireless communication system. Among them, Software Communication Architecture (SCA) has become the most widely used technical standard in the field of software radio after more than 20 years of development. SCA specifies the hardware and software architecture, security architecture and API interface specifications, aiming to achieve hardware modularity and software portability, reusability and interoperability.
[0003] For waveform applications on the SCA platform, the software platform parses component configuration information to obtain a list of devices that can be loaded with the component, and determines whether the component can be loaded into the device one by one. However, the SCA standard currently only describes the configuration of multi-core processors, and lacks a fine-grained resource scheduling method for each computing core, resulting in coarse granularity and poor adaptability of the device matching for waveform component loading and operation, making it difficult to perform fine-grained control of computing units, and unable to meet the parallel scheduling requirements of future waveform intelligent algorithm modules.
[0004] OpenCL is the most widely used framework for parallel computing. It defines a platform model for host and device interaction. It can obtain detailed device information through APIs, control device-side parallel computing through the host, support multiple intelligent computing frameworks, and effectively solve the acceleration requirements of SCA platform intelligent model applications. However, there is a device partition conflict between OpenCL loading and SCA component loading: the SCA core framework allocates devices for the entire waveform component, and the host-side program of the OpenCL component will query the allocated platform device again. If it is scheduled to other devices, the SCA core framework cannot uniformly manage the operating status of the entire platform.
[0005] Therefore, it is urgent to integrate the OpenCL framework and optimize the scheduling of SCA parallel computing devices, improve the matching degree of platform running devices, effectively manage the entire platform, avoid the failure of fine-grained loading of OpenCL components due to insufficient device loading capacity, and improve the loading capacity of waveform intelligent components. Summary of the invention
[0006] 1. Technical problems to be solved
[0007] In view of the problem of low operating efficiency of SCA components on heterogeneous devices in the prior art, the present application provides an OpenCL-based SCA component heterogeneous parallel loading scheduling method, which improves the operating efficiency of SCA components by matching and scheduling heterogeneous devices and utilizing the OpenCL heterogeneous parallel platform.
[0008] 2. Technical solution
[0009] The purpose of this application is achieved through the following technical solutions.
[0010] One aspect of the present application provides an OpenCL-based SCA component heterogeneous parallel loading scheduling method, comprising: parsing a waveform SAD configuration file, obtaining a component list, and obtaining corresponding components according to the component list; parsing a PRF configuration file corresponding to each component according to the obtained components; judging whether the corresponding component belongs to an OpenCL component according to the PRF configuration file, and if so, obtaining the loading parameters of the OpenCL component of the corresponding component; obtaining a device in the SCA platform that supports OpenCL component loading, and obtaining the operating status of the device that supports OpenCL component loading; calculating the loading matching requirements of the OpenCL component according to the obtained loading parameters of the OpenCL component; obtaining the corresponding device that supports OpenCL component loading from the SCA platform according to the loading matching requirements; judging the loading as an OpenCL component according to the obtained device that supports OpenCL component loading; and calling the interface in the waveform SAD configuration file to start the waveform after loading the component according to the obtained waveform SAD configuration file.
[0011] The Waveform SAD Configuration File refers to a software architecture description file, which is a file that describes the architecture and components of a software system. The Waveform SAD Configuration File is a SAD file for a specific waveform application, which describes the software architecture and components of the waveform application. By parsing the Waveform SAD Configuration File, you can obtain information about each component contained in the waveform application, such as the component list, the type of each component, and the configuration parameter file path.
[0012] PRF configuration file (Properties File) refers to a property file used to store various property parameters of software components. Each component has a corresponding PRF configuration file, which contains important information such as the component type, supported parallel frameworks, dependent hardware and operating system, etc. By parsing the component's PRF configuration file, you can determine whether the component belongs to the OpenCL type, and obtain various parameters required for OpenCL component loading.
[0013] OpenCL component is a heterogeneous parallel programming framework that can use different processors such as CPU, GPU, FPGA to accelerate computing. Software components that support OpenCL are called OpenCL components, which include host programs and device kernel programs developed for the OpenCL framework. OpenCL components can be loaded and executed in parallel on heterogeneous devices that support the OpenCL environment, giving full play to the acceleration capabilities of various heterogeneous computing resources.
[0014] The SCA platform (Software Communication Architecture Platform) is an architecture specification based on software radio, which is used to develop portable and reusable software radio systems. The SCA platform is a hardware and software environment that complies with the SCA specification, including heterogeneous computing devices such as general purpose processors (GPP), digital signal processors (DSP), field programmable gate arrays (FPGA), as well as SCA middleware, development libraries and tool chains. The SCA platform provides a deployment and operating environment for software radio components, and different types of components can be loaded and scheduled for execution on corresponding heterogeneous devices. In this application, the component list is first obtained by parsing the waveform SAD configuration file, and then the component SPD configuration file is parsed to determine whether each component belongs to the OpenCL type one by one. For the OpenCL component, the loading parameters are extracted from its PRF configuration file, and the heterogeneous devices that support OpenCL on the SCA platform are matched according to the parameters. After matching the optimal device, the OpenCL component is loaded onto the device for operation. The whole process realizes the adaptive loading and scheduling of SCA components based on OpenCL on the heterogeneous SCA platform, making full use of heterogeneous computing resources.
[0015] Furthermore, judging whether the corresponding component belongs to the OpenCL component according to the SPD configuration file includes: parsing the SPD configuration file corresponding to each component to obtain component information; judging whether the corresponding component belongs to the OpenCL type; parsing the PRF configuration file to obtain the configuration parameters of the component; if the component belongs to the OpenCL type, obtaining the loading parameters of the OpenCL component of the corresponding component according to the corresponding configuration parameters, the OpenCL component loading parameters including the kernel file, memory space, running device dependency and OpenCL running parameters of the OpenCL component.
[0016] Among them, the kernel file is a source code file or binary file containing the OpenCL kernel function. The kernel function is the code unit of the parallel computing task executed on the OpenCL device. It is written in OpenCL C language and can be compiled into executable instructions for the target device. The kernel file is a key component of the OpenCL component and determines the computing behavior of the component on heterogeneous devices. When loading the OpenCL component, the kernel file needs to be compiled and loaded to the specified OpenCL device.
[0017] Memory Space: OpenCL components require certain memory resources when executing to store input data, intermediate results, and output data. Memory space refers to the memory size and layout required by OpenCL components on the host and device sides. The OpenCL runtime API allows data transfer and memory management between host memory and device memory. The PRF configuration file of the OpenCL component will describe the memory space information required by the component. When loading the component, memory needs to be allocated on the corresponding device based on this information.
[0018] Runtime Device Dependency: The operation of OpenCL components depends on specific hardware devices, such as GPU, FPGA, etc. Different types and models of devices have different support levels and performance for OpenCL. Runtime device dependency refers to the requirements of OpenCL components for hardware device type, computing power, driver version, etc. The PRF configuration file of the OpenCL component will describe the runtime device dependency of the component. When loading the component, you need to select the appropriate OpenCL device based on these dependencies.
[0019] OpenCL runtime parameters are a series of parameters related to the runtime behavior of OpenCL components, such as workgroup size, memory object type, synchronization method, etc. These parameters affect the execution efficiency and resource utilization of OpenCL kernel functions. The PRF configuration file of the OpenCL component will contain recommended or default runtime parameter values. When loading the OpenCL component, you can adjust these parameters according to the actual situation to optimize the running performance of the component on a specific device.
[0020] The SPD (Software Package Descriptor) configuration file is an XML-formatted file defined in the SCA (Software Communications Architecture) specification, which is used to describe the basic information and interface characteristics of SCA components. In this application, the key information obtained by parsing the SPD configuration file is the component's implementation description and resource requirements. According to the component implementation code features (such as file extensions, keywords, etc.) given in the implementation description, it can be determined whether the component is an OpenCL implementation, that is, whether it needs to be loaded and executed on a heterogeneous device that supports OpenCL. The component resource requirement information helps to match the most appropriate heterogeneous computing resources.
[0021] In this application, in the process of determining whether a component is an OpenCL component, the SPD and PRF configuration files are first parsed to obtain the configuration information of the component and determine whether the component type is OpenCL. If it is an OpenCL type, the kernel file, memory space, operating device dependency, and operating parameters and other necessary information for loading are extracted based on the parallel computing framework support information in the PRF configuration file to form a complete OpenCL component loading parameter for the subsequent component loading and scheduling process.
[0022] Furthermore, the corresponding device supporting OpenCL component loading is obtained from the SCA platform according to the loading matching requirements, including: obtaining parameters of the loading device in the SCA platform, the parameters including device type, device loading capability, device running status and loading capacity; matching the corresponding device supporting OpenCL component loading from the SCA platform according to the SCA standard according to the obtained parameters and the loading parameters of the OpenCL component of the obtained OpenCL component; for the device matched to support OpenCL component loading, selecting the OpenCL loading device according to the loading parameters of the OpenCL component of the OpenCL component, and matching the host-side program of the OpenCL component to the CPU device in the SCA platform; completing the final component matching according to the component running configuration parameters and the device running status; and obtaining a corresponding relationship list between the component and the loading device according to the device ID of the selected loading device.
[0023] Further, according to the acquired device supporting OpenCL component loading, loading is judged as an OpenCL component, including: selecting an OpenCL loading device corresponding to the OpenCL component according to the acquired correspondence list between the OpenCL component and the OpenCL loading device; loading the kernel program of the OpenCL component into the selected OpenCL loading device according to the kernel file in the acquired loading parameters of the OpenCL component of the OpenCL component; allocating the memory space of the OpenCL component on the selected OpenCL loading device according to the acquired memory space in the loading parameters of the OpenCL component of the OpenCL component; setting the running parameters of the OpenCL component on the selected OpenCL loading device according to the OpenCL running parameters in the acquired loading parameters of the OpenCL component of the OpenCL component; loading the host-side program of the OpenCL component on the CPU device of the SCA platform, and establishing communication with the kernel program of the selected OpenCL loading device to complete the loading of the OpenCL component.
[0024] Among them, CPU device (CPU Device), CPU (Central Processing Unit) device refers to the general processor device in the SCA platform, usually a multi-core processor of the x86 architecture. In a heterogeneous computing environment, the CPU is mainly responsible for executing serial general tasks, such as business logic, data preprocessing, task distribution, and result aggregation. The CPU device communicates and works with other heterogeneous computing devices through the OpenCL runtime and driver. The host program of the OpenCL component generally runs on the CPU device, and interacts and transmits data with the kernel program on the acceleration device through the OpenCL API.
[0025] Host Program, the OpenCL host program is a common C / C++ program running on the CPU, responsible for initializing the OpenCL environment, managing memory objects, loading and compiling kernel programs, setting kernel parameters, executing kernels, transmitting data, and coordinating the synchronization of parallel tasks between the host and the device. The host program interacts with the OpenCL runtime through OpenCL API function calls to achieve control and utilization of heterogeneous devices. The host program of the OpenCL component is the control center of the component, and together with the kernel program on the device side, completes the parallel computing tasks of the component.
[0026] In this application, in the process of loading a component judged as an OpenCL component, first, according to the correspondence list between the OpenCL component and the OpenCL loading device, the target device corresponding to the component is selected. Then, the kernel file is extracted from the loading parameters of the component, compiled and loaded onto the selected device, and then the required memory resources are allocated on the device according to the memory space parameters. Next, the OpenCL running parameters are set to the kernel program to control its parallel execution behavior. Finally, the host-side program of the OpenCL component is loaded on the CPU device, and a communication connection is established between it and the kernel program on the loading device. At this point, the loading process of the OpenCL component on the heterogeneous platform is completed, and the host-side program can call the kernel program through the OpenCL API to collaboratively complete the parallel computing task. This heterogeneous parallel loading scheduling method for SCA components based on OpenCL fully considers the characteristics of the OpenCL component and the architecture of the heterogeneous platform, realizes the adaptive mapping and dynamic loading of components to hardware, and improves the parallel performance and flexibility of the SCA system. Among them, the host-side program and the kernel program are executed on the CPU and the acceleration device respectively, and work together through data transmission and synchronization mechanisms, showing the advantages of heterogeneous collaborative computing.
[0027] Furthermore, according to the kernel file in the loading parameters of the OpenCL component obtained, the kernel program of the OpenCL component is loaded into the selected OpenCL loading device, including: according to the kernel file in the loading parameters of the OpenCL component, obtaining the source code or binary file of the kernel file; using the API function of the OpenCL component runtime, compiling and loading the obtained source code or binary file into the selected OpenCL loading device.
[0028] Further, according to the memory space in the loading parameters of the OpenCL component of the acquired OpenCL component, the memory space of the OpenCL component is allocated on the selected OpenCL loading device, including: according to the memory space of the OpenCL component, calling the API function of the OpenCL component runtime, and allocating the memory space of the specified size on the selected OpenCL loading device.
[0029] Furthermore, the waveform SAD configuration file is parsed to obtain a component list, and corresponding components are obtained according to the component list, including: parsing the component description information in the waveform SAD configuration file to obtain the component name, type and configuration parameter file path; generating a component list according to the obtained component name, type and configuration parameter file path.
[0030] Another aspect of the present application also provides an OpenCL-based SCA component heterogeneous parallel loading scheduling system, including: a file parsing module, parsing a waveform SAD configuration file, obtaining a component list, and obtaining corresponding components according to the component list; an OpenCL parameter extraction module, parsing the SPD configuration file corresponding to each component, judging whether the corresponding component belongs to an OpenCL component according to the SPD configuration file, and if so, parsing the PRF configuration file to obtain the OpenCL component loading parameters of the corresponding component; a platform device manager module, obtaining a list of devices loaded in the SCA platform and their operating status, and obtaining OpenCL loading information of devices that support OpenCL component loading; a waveform The application factory module obtains the list of waveforms in the platform and the component list information contained in each waveform; the OpenCL device matching module calculates the loading matching requirements of the OpenCL component according to the loading parameters of the OpenCL component, and reads the platform device manager module to obtain the corresponding device that supports the loading of the OpenCL component from the SCA platform according to the loading matching requirements of the OpenCL component; the OpenCL device loading module completes the loading of the host-side program and the device-side kernel program of the OpenCL component, loads the OpenCL host-side program according to the allocated CPU device, and loads the device-side kernel program of the OpenCL component according to the obtained device that supports the loading of the OpenCL component.
[0031] Another aspect of the present application also provides a heterogeneous hardware system, including: a host device, running an OpenCL-based SCA component heterogeneous parallel loading scheduling system; at least two general-purpose processors, connected to the host device, executing the host-side program and computing tasks of the SCA component; at least one heterogeneous computing device, connected to the host device, executing the kernel program of the OpenCL component; the host device communicates with each CPU and a device supporting OpenCL component loading through an API interface when the OpenCL component is running, and loads the OpenCL component onto a matching heterogeneous computing device for execution; the CPU returns the execution result of the OpenCL component to the host device through an API interface when the OpenCL component is running; the heterogeneous computing device receives the kernel program, memory space and operating parameters sent by the host device through the API interface when the OpenCL component is running, loads and executes the kernel program of the OpenCL component, and returns the execution result to the host device through the API interface when the OpenCL component is running.
[0032] 3. Beneficial effects
[0033] Compared with the prior art, the advantages of this application are:
[0034] (1) The OpenCL-based SCA component heterogeneous parallel loading scheduling method provided in this application obtains the loading parameters of the OpenCL component of the component by parsing the configuration file, matches the optimal heterogeneous loading device, deploys the component directly to the matching device, and adopts OpenCL API to compile the kernel, ABI to load binary code and other mechanisms, thereby reducing the intermediate links of component loading scheduling and effectively improving the waveform component loading efficiency and performance.
[0035] (2) This application matches the optimal CPU and OpenCL heterogeneous loading devices according to the component's operating device dependencies, memory space, operating parameters and other requirements, so that the SCA component can flexibly adapt and fully utilize the heterogeneous parallel processing capabilities of the platform device, improving the device adaptability of component loading. When the platform device changes, there is no need to modify the waveform and components, and the loading parameters of the component's OpenCL component can be adjusted to re-adapt, thereby improving operating efficiency.
[0036] (3) By establishing a correspondence between components and matching devices, the components are directly deployed to the corresponding CPU and OpenCL devices, which reduces the data transmission between components and gives full play to the collaborative parallel advantages of CPU and OpenCL devices, thereby improving the SCA heterogeneous parallel processing performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a flow chart according to an embodiment of the present application;
[0038] Figure 2 is a diagram of component module parsing steps according to an embodiment of the present application;
[0039] Figure 3 is a diagram of device dependency matching steps according to an embodiment of the present application;
[0040] Figure 4 is a diagram of component loading steps according to an embodiment of the present application;
[0041] Figure 5 This is a schematic diagram of the SCA component device loading correspondence relationship according to an embodiment of the present application;
[0042] Figure 6 This is a schematic diagram of the corresponding relationship of component devices supporting OpenCL according to an embodiment of the present application;
[0043] Figure 7 This is a module composition diagram of a heterogeneous parallel loading scheduling system according to an embodiment of the present application. DETAILED DESCRIPTION
[0044] The present application is described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0045] Reference Figure 1 As shown, the SCA waveform creation and release optimization method based on component dormancy of the present application includes the following steps:
[0046] First, parse the waveform SAD configuration file, obtain the component list, and obtain the corresponding component according to the component list; specifically,
[0047] Read the waveform SAD configuration file, which is usually an XML file with the suffix "sad.xml". The Software Assembly Descriptor (SAD) configuration file is used to describe a complete waveform application, including information such as a component list and the connection relationship between components. It provides the overall structure and component composition information of the waveform application and is the starting point for parsing and loading waveforms.
[0048] Parse the XML content of the SAD configuration file to obtain detailed configuration information of the component, such as component type, component attributes, component implementation code, etc. Store the parsed component identifier and configuration information into the component list data structure to form a complete component list. The component list contains the data structure of the identifiers and configuration information of all components in the waveform application, centrally manages the component information of the waveform application, and facilitates subsequent component loading, instantiation, and connection operations. Specifically, obtain <componentfiles>Elements. Traversal <componentfiles>Each element under <componentfile>Sub-element: Get <componentfile>The "id" attribute value of the component is used as a unique identifier for the component; get <componentfile>Down <localfile>The "name" attribute value of the element is used as the SPD configuration file path corresponding to the component. According to the parsed SPD configuration file path, read the SPD configuration file of each component, which is usually an XML file with the suffix "spd.xml". Among them, the Software Package Descriptor (SPD) configuration file is used to describe the detailed information of a single component, such as component type, attributes, implementation code, etc., and provides metadata and implementation details of the component, which is the basis for loading and instantiating the component.
[0049] like Figure 2 As shown, according to the obtained components, the PRF configuration files corresponding to each component are parsed, including: reading the SPD configuration file of the component, which is usually an XML file with the suffix "spd.xml". Parsing the XML content of the SPD configuration file to obtain the description information of the component: <implementation>Element information, including component implementation platform processor, operating system, etc. Get <code>The information of the element includes binary file name, entry parameters, stack size, priority, etc. In the standard SPD file format, <code>Add "OpenCL" type to the element's type attribute to determine <code>Whether the "type" attribute of the element is "OpenCL" is used to determine whether the component is an OpenCL component, and whether the component is an OpenCL component is stored for future component type judgment. This step is not available in the existing SCA specification. By adding the OpenCL type identifier, OpenCL components can be easily screened out and matched to appropriate heterogeneous computing resources during subsequent scheduling, giving full play to the advantages of OpenCL heterogeneous parallelism and improving component execution efficiency. Specifically, by reading the SPD configuration file <propertyfile>The "localfile" attribute of the element can obtain the PRF configuration parameter file of the component and read the PRF configuration file of the component, which is usually an XML file with the suffix "prf.xml". Parse the XML content of the PRF configuration file to obtain the configuration parameters of the component: In the component information acquisition step, it has been determined whether it is an OpenCL component. If it is an OpenCL component, the kernel file, memory space, running device dependency, OpenCL version, running parameters, etc. in the PRF file are saved separately. If it is not an OpenCL component, the PRF configuration file parameters are parsed normally to save the component running configuration parameters. Based on the original SCA component parsing process, this application adds the identification of OpenCL type components and the extraction of OpenCL-specific configuration parameters, laying the foundation for the subsequent matching and scheduling of heterogeneous devices. Through the expansion and optimization of OpenCL, the heterogeneous computing potential of SCA components is fully tapped, and the problem of low operating efficiency of heterogeneous devices of SCA components in the prior art is overcome.
[0050] According to the PRF configuration file, determine whether the corresponding component belongs to the OpenCL component. If so, obtain the loading parameters of the OpenCL component of the corresponding component. Among them, the Properties File (PRF) configuration file is used to describe the property information of the component, including the parameters, configuration, resource requirements, etc. of the component, and provide the configurable property information of the component. When the component is loaded and instantiated, the component can be configured and customized according to the property values in the PRF file. OpenCL component is an SCA component implemented based on the OpenCL (Open Computing Language) parallel computing framework. Using the heterogeneous computing capabilities of OpenCL, parallel acceleration can be performed on devices that support OpenCL (such as GPU, FPGA, etc.). The loading of OpenCL components requires specific parameters, such as OpenCL platform, device, kernel file, memory object, etc. These parameters are specified in the component's PRF configuration file.
[0051] Specifically, in this embodiment, the OpenCL parameters in the PRF configuration file are parsed: by adding parameters such as "clKernel", "clBuffer", "clDeviceType", "clVersion", and "clArgs" to the PRF component configuration file to describe the kernel file, memory space, operating device dependency, OpenCL version, operating parameters, and other information of the OpenCL component. Among them: Get the kernel file parameters, corresponding to <simple>The "name" attribute of the element is "clKernel" and the type is "string". Get the memory space parameters, corresponding to <simple>The "name" attribute of the element is "clBuffer" and the type is "integer". Get the running device dependent parameters, corresponding to <simple>The "name" attribute of the element is "clDeviceType", the type is "string", and the value can be "CL_DEVICE_CPU", "CL_DEVICE_GPU", "CL_DEVICE_FPGA", etc. Get the OpenCL version parameters, corresponding to <simple>The "name" attribute of the element is "clVersion" and the type is "string". Get the OpenCL running parameters, corresponding to <simple>The "name" attribute of the element is "clArgs" and the type is "string". The obtained OpenCL parameters are stored for subsequent OpenCL component loading and initialization.
[0052] Get the device that supports OpenCL component loading in the SCA platform, and get the running status of the device that supports OpenCL component loading; Figure 3 As shown, the platform loads device information acquisition: traverse all loaded devices on the platform, and for each device, obtain the device ID (device identification). For devices that support OpenCL component loading, call its query method to obtain the device's OpenCL related information: Get the device type clDeviceType, including CL_DEVICE_CPU, CL_DEVICE_GPU, CL_DEVICE_FPGA, etc. Get the queue length clWgSize, which indicates the maximum workgroup size supported by the device. Get the memory capacity clMemSize, which indicates the available memory size of the device. Get the OpenCL version clVersion, which indicates the OpenCL version supported by the device. Get the device operating status: Get the device's adminState (device management status), including locked, unlocked, shut down, etc. Get the device's usageState (device usage status), including idle, running, busy, etc. Get the device's operationalState (device operation status), including available, unavailable, etc. Store the acquired device information in a data structure, such as a dictionary or list, for subsequent component matching and loading.
[0053] According to the obtained loading parameters of the OpenCL component, the loading matching requirements of the OpenCL component are calculated, and the corresponding device that supports the loading of the OpenCL component is obtained from the SCA platform according to the loading matching requirements. Specifically, the component list of the waveform is traversed, and for each component: if the component is an OpenCL component, according to the OpenCL parameters obtained in the step component module parsing, according to the device-side kernel program running requirements of the component, including device type, memory capacity, OpenCL version, etc., the loading device information of the currently traversed platform is matched to determine whether the device type is consistent, whether the OpenCL version is compatible, and whether the device memory capacity meets the component memory space requirements. If the match is successful, its OpenCL host-side program is assigned a CPU device. If the match fails, the next platform loading device is traversed. When the OpenCL device and component are matched, the running state is matched again through the component running configuration parameters. If the current device running state is unlocked, idle, and available, the component and device complete the final match, and the correspondence between the component and the device is stored in a list or dictionary, including the component ID and the device ID. At this time, if it is an OpenCL component, the matching of its device-side kernel program and the OpenCL loading device is completed. If the match fails, continue to traverse the next device. For OpenCL components that still cannot find a matching device after traversing the platform devices, the following processing methods can be adopted: record the unmatched component information, such as component ID and required parameters. In the subsequent error handling or logging, prompt the user that there is a lack of suitable equipment. When the component is matched, continue to traverse the next component until all components are matched, and return the corresponding relationship list between the waveform component and the device, including the successfully matched component ID and device ID.
[0054] According to the obtained device supporting OpenCL component loading, the loading is judged as OpenCL component. Specifically, the user program and kernel program of the OpenCL component are obtained and loaded into the corresponding CPU and OpenCL device respectively; Figure 4 As shown, loading capacity allocation: according to the waveform component loading requirements, call the allocateCapacity() method on the loading device to allocate the loading capacity interface.
[0055] Call the load(*) interface on the loading device to load the waveform component binary code; specifically, if the component is a common SCA component, it will directly jump to the component execution step after loading; if the component is an OpenCL component, after the OpenCL host-side program is loaded on the CPU side, its OpenCL device-side kernel program is read out through the kernel file corresponding to "clKernel" in the component PRF configuration file, and the OpenCL API interface clCreateKernel function is called to compile the kernel program, and according to the kernel program memory capacity requirement corresponding to "clBuffer" in the component PRF configuration file, the corresponding cache space is allocated on the corresponding allocated OpenCL device; this application utilizes the characteristics of the OpenCL heterogeneous parallel platform, optimizes data transmission and access efficiency by allocating the memory required by the kernel in advance, and effectively improves the component operation performance.
[0056] Figure 5 The schematic diagram of the corresponding relationship between SCA components loaded onto corresponding devices for operation is shown in Figure 1. The waveform includes multiple components: waveform controller component, component 1, component 2, ..., until component N. After the corresponding devices are assigned, each component is loaded onto the corresponding CPU, GPU, FPGA and other loading devices for operation. This fine-grained component-level heterogeneous loading fully utilizes the computing advantages of heterogeneous hardware and overcomes the problem of low operating efficiency of SCA components on heterogeneous devices in the prior art.
[0057] Figure 6 The device operation corresponding schematic relationship for supporting OpenCL component loading is shown, which contains an OpenCL component. The host side and kernel program in the component are loaded to the CPU and GPU devices respectively through this method. Compared with the traditional method that can only be loaded to the CPU, this application realizes the flexible loading of SCA components on various heterogeneous devices such as CPU and GPU through heterogeneous device matching scheduling, effectively controls the platform loading device, improves the component loading success rate, and avoids the problem of being unable to load due to insufficient device loading capacity. At the same time, thanks to the superior heterogeneous parallel performance of OpenCL, the operating efficiency of SCA components is also greatly improved. This application solves the problem of low operating efficiency of heterogeneous devices of existing SCA components by enhancing heterogeneous device matching and OpenCL environment support in the component loading stage. This method can dynamically select the best heterogeneous device for loading according to component characteristics and device status, and fully tap the hardware performance through the heterogeneous parallel mechanism of OpenCL, while ensuring the loading success rate and significantly improving the component execution efficiency.
[0058] Optionally, if the component loading type is Executable, you need to call the execute(*) method on the loading device to execute the binary code of the component and save the component process ID; if the component is an OpenCL component, call the OpenCL API interface clSetKernel function on the corresponding allocated device to set its kernel execution parameters, and the kernel execution parameters are obtained by parsing the "clArgs" parameter in the PRF configuration file. Component registration: After the component is loaded, register its own object with the registration manager of the application factory component. Component port connection: After all components of the waveform are registered, call the connectUsesPort(*) method of the component PortAccessor interface to complete the port connection; Waveform initialization configuration: Find the assembly controller component instance of the waveform according to the waveform configuration file and configure the initialization parameters of the waveform. The platform realizes the synchronous control and loading and running of SCA waveforms and OpenCL components by unified interface management and unified configuration description of OpenCL devices and components. Waveform start: Call the start(*) interface to start the waveform.
[0059] Correspondingly, such as Figure 7 As shown, the present invention also provides an SCA component heterogeneous parallel loading scheduling system based on OpenCL, including: a file parsing module, parsing a waveform SAD configuration file, obtaining a component list, and obtaining corresponding components according to the component list; an OpenCL parameter extraction module, parsing an SPD configuration file corresponding to each component, judging whether the corresponding component belongs to an OpenCL component according to the SPD configuration file, and if so, parsing a PRF configuration file to obtain the OpenCL component loading parameters of the corresponding component; a platform device manager module, obtaining a list of devices loaded in the SCA platform and their operating status, and obtaining OpenCL loading information of the devices that support OpenCL component loading; a waveform application Use the factory module to obtain the list of waveforms in the platform and the component list information contained in each waveform; the OpenCL device matching module calculates the loading matching requirements of the OpenCL component according to the loading parameters of the OpenCL component, and reads the platform device manager module to obtain the corresponding device that supports the loading of the OpenCL component from the SCA platform according to the loading matching requirements of the OpenCL component; the OpenCL device loading module completes the loading of the host-side program and the device-side kernel program of the OpenCL component, loads the OpenCL host-side program according to the allocated CPU device, and loads the device-side kernel program of the OpenCL component according to the acquired device that supports the loading of the OpenCL component.
[0060] This application introduces OpenCL-related configuration parameters in the SPD and PRF configuration files of the SCA component, such as <code>"OpenCL" type, "clKernel" (kernel file), "clBuffer" (memory requirements), "clArgs" (kernel execution parameters), etc. During component loading, read the component's SPD and PRF configuration files, and parse to obtain OpenCL-related parameters. Based on the OpenCL parameters, perform fine-grained resource allocation and management on the platform's OpenCL devices, such as memory allocation and kernel compilation. Through unified OpenCL parameter configuration and management, unified control of OpenCL components is achieved, improving the success rate of component loading.
[0061] This application improves the loading capacity of OpenCL components and introduces support for OpenCL devices, such as GPU, FPGA, etc., in the platform's device management. In the device interface, add OpenCL-related methods, such as clCreateKernel, clSetKernel, etc. During component loading, select the appropriate OpenCL device for loading and execution based on the component's OpenCL parameters. Through fine-grained OpenCL device management and component loading, the loading capacity of OpenCL components is effectively improved, avoiding loading failures caused by the inability to uniformly control devices.
[0062] This application uses the parallel computing capabilities of the OpenCL component. The OpenCL component is executed on the OpenCL device through the kernel program, which can utilize the parallel computing capabilities of the device. During the component loading process, the kernel program is compiled and loaded onto the OpenCL device, and the kernel execution parameters are set through the clSetKernel method. During the component execution process, the kernel execution is started through the OpenCL API interface, and the parallel computing capabilities of the device are used to improve the computing efficiency of the component.
[0063] This application is an extension of the SCA core framework platform, introducing support for OpenCL components. In the process of component loading and port connection, SCA standard methods are still used, such as load(*), connectUsesPort(*), etc. By extending OpenCL support on the standard SCA framework, standard compliance of the waveform deployment process is guaranteed.
[0064] The invention of the present application and its implementation methods are described schematically above. The description is not restrictive. Without departing from the spirit or basic features of the present application, the present application can be implemented in other specific forms. What is shown in the accompanying drawings is only one of the implementation methods of the invention of the present application. The actual structure is not limited to this. Any figure mark in the claims should not limit the claims involved. Therefore, if ordinary technicians in this field are inspired by it, without departing from the purpose of the present invention, they can design structural methods and embodiments similar to the technical solution without creativity, which should all fall within the scope of protection of this patent. In addition, the word "including" does not exclude other elements or steps, and the word "one" before the element does not exclude the inclusion of "multiple" elements. The multiple elements stated in the product claim can also be implemented by one element through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.< / code> < / simple> < / simple> < / simple> < / simple> < / simple> < / propertyfile> < / code> < / code> < / code> < / implementation> < / localfile> < / componentfile> < / componentfile> < / componentfile> < / componentfiles> < / componentfiles>
Claims
1. A method for scheduling heterogeneous parallel loading of SCA components based on OpenCL, characterized in that: include: Parse the waveform SAD configuration file, obtain the component list, and obtain the corresponding component according to the component list; According to the obtained components, parse the PRF configuration files corresponding to each component; Determine whether the corresponding component belongs to an OpenCL component according to the PRF configuration file, and if so, obtain the loading parameters of the OpenCL component of the corresponding component; if not, save the PRF configuration file; Obtain the device that supports OpenCL component loading in the SCA platform, and obtain the running status of the device that supports OpenCL component loading; Calculate the loading matching requirement of the OpenCL component according to the obtained loading parameters of the OpenCL component; Obtain the corresponding device that supports OpenCL component loading from the SCA platform according to the loading matching requirements; According to the acquired device supporting OpenCL component loading, the loading is judged as an OpenCL component; According to the obtained waveform SAD configuration file, load the corresponding component, and call the interface in the waveform SAD configuration file to start the waveform.
2. The OpenCL-based SCA component heterogeneous parallel loading scheduling method according to claim 1 is characterized by: Determine whether the corresponding component belongs to the OpenCL component according to the PRF configuration file, including: Parse the SPD configuration files corresponding to each component, obtain component information, and determine whether the corresponding component belongs to the OpenCL type; Parse the PRF configuration files corresponding to each component to obtain the configuration information and configuration parameters of the component; If the component is of OpenCL type, the loading parameters of the OpenCL component of the corresponding component are obtained according to the corresponding configuration parameters. The OpenCL component loading parameters include the kernel file, memory space, running device dependency and OpenCL running parameters of the OpenCL component.
3. The OpenCL-based SCA component heterogeneous parallel loading scheduling method according to claim 1 is characterized in that: According to the loading matching requirements, the corresponding device that supports OpenCL component loading is obtained from the SCA platform, including: Obtain the parameters of the loaded device in the SCA platform, including device type, device loading capability, device operating status and loading capacity; According to the obtained parameters and the obtained loading parameters of the OpenCL component, and the SCA standard, a corresponding device supporting the loading of the OpenCL component is matched from the SCA platform; For the device matched to support OpenCL component loading, the OpenCL loading device is selected according to the loading parameters of the OpenCL component, and the host-side program of the OpenCL component is matched to the CPU device in the SCA platform.
4. The OpenCL-based SCA component heterogeneous parallel loading scheduling method according to claim 3 is characterized in that: According to the obtained device that supports OpenCL component loading, loading is judged as OpenCL component, including: According to the obtained correspondence list between the OpenCL components and the OpenCL loading devices, select the OpenCL loading device corresponding to the OpenCL component; Loading the kernel program of the OpenCL component into the selected OpenCL loading device according to the kernel file in the loading parameters of the OpenCL component obtained; Allocate the memory space of the OpenCL component on the selected OpenCL loading device according to the memory space in the loading parameters of the OpenCL component obtained; According to the obtained OpenCL running parameters in the loading parameters of the OpenCL component, setting the running parameters of the OpenCL component on the selected OpenCL loading device; The host program of the OpenCL component is loaded on the CPU device of the SCA platform, and communication is established with the kernel program of the selected OpenCL loading device to complete the loading of the OpenCL component.
5. The OpenCL-based SCA component heterogeneous parallel loading scheduling method according to claim 4 is characterized in that: According to the kernel file in the loading parameter of the OpenCL component of the obtained OpenCL component, the kernel program of the OpenCL component is loaded into the selected OpenCL loading device, including: According to the kernel file in the loading parameters of the OpenCL component, the source code or binary file of the kernel file is obtained; The obtained source code or binary file is compiled and loaded into the selected OpenCL loading device using the API function of the OpenCL component runtime.
6. The OpenCL-based SCA component heterogeneous parallel loading scheduling method according to claim 4 is characterized by: Allocating the memory space of the OpenCL component on the selected OpenCL loading device according to the memory space in the loading parameter of the OpenCL component obtained, including: According to the memory space of the OpenCL component, the API function of the OpenCL component runtime is called to allocate the memory space of the specified size on the selected OpenCL loading device.
7. The OpenCL-based SCA component heterogeneous parallel loading scheduling method according to any one of claims 2 to 6, characterized in that: Parse the waveform SAD configuration file, obtain the component list, and obtain the corresponding component according to the component list, including: Parse the component description information in the waveform SAD configuration file to obtain the component name, type and configuration parameter file path; Generate a component list based on the obtained component name, type and configuration parameter file path.
8. An OpenCL-based SCA component heterogeneous parallel loading scheduling system, characterized in that: include: The file parsing module parses the waveform SAD configuration file, obtains the component list, and obtains the corresponding component according to the component list; The OpenCL parameter extraction module parses the SPD configuration files corresponding to the obtained components, and determines whether the corresponding components belong to the OpenCL components according to the SPD configuration files. If yes, the PRF configuration files are parsed to obtain the loading parameters of the OpenCL components of the corresponding components. The platform device manager module obtains the list of devices loaded in the SCA platform and their corresponding operating status, and obtains the OpenCL loading information of devices that support OpenCL component loading; The waveform application factory module obtains the list of waveforms in the platform and the component list information contained in each waveform; The OpenCL device matching module calculates the loading matching requirements of the OpenCL component according to the loading parameters of the OpenCL component, and reads the platform device manager module to obtain the corresponding device that supports the loading of the OpenCL component from the SCA platform according to the loading matching requirements of the OpenCL component; The OpenCL device loading module completes the loading of the host-side program and the device-side kernel program of the OpenCL component. It loads the host-side program of OpenCL according to the allocated CPU device, and loads the device-side kernel program of the OpenCL component according to the acquired device that supports OpenCL component loading.
9. A heterogeneous hardware system, characterized in that: include: The host device runs the OpenCL-based SCA component heterogeneous parallel loading scheduling system; at least two general-purpose processors, connected to the host device, to execute host-side programs and computing tasks of the SCA components; at least one heterogeneous computing device, connected to the host device, and executing a kernel program of the OpenCL component; The host device communicates with each CPU and the device supporting the loading of OpenCL components through the API interface of the OpenCL component runtime, and loads the OpenCL components to the matching heterogeneous computing device for execution; The CPU returns the execution result of the OpenCL component to the host device through the API interface of the OpenCL component runtime; The heterogeneous computing device receives the kernel program, memory space and operating parameters sent by the host device through the API interface of the OpenCL component runtime, loads and executes the kernel program of the OpenCL component, and returns the execution result to the host device through the API interface of the OpenCL component runtime.
Citation Information
Patent Citations
SCA-based dynamic partially reconfigurable device resource virtualization and waveform deployment method
CN111262742A
Heterogeneous multi-core SOC processor-based SCA waveform dynamic local reconfiguration method and device
CN116166610A
Generically Managing the Configuration of Heterogeneous Software Artifacts
US20080320467A1
Heterogeneous multiprocessor program compilation targeting programmable integrated circuits
WO2016077393A1