OpenCL digital simulation method and system
Through the virtual OpenCL driver library and interface forwarding library, the problem that the existing technology cannot simulate and test OpenCL code is solved, efficient parallel computing and cross-platform OpenCL simulation in the virtual machine are realized, and the existing technology cannot verify OpenCL behavior and Performance issues.
Patent Information
- Application Number
- CN202411354681.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-11-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing digital simulation platforms cannot directly simulate and test OpenCL code, and cannot verify OpenCL behavior and performance under different hardware or software configurations.
By creating a virtual OpenCL driver library and an interface forwarding library, replacing the application's default OpenCL driver library, and integrating the virtual OpenCL interface forwarding library in the virtual machine, implementing a parallel computer system for task segmentation and data segmentation, and completing OpenCL simulation.
Without changing the customer application source program, efficient parallel computing capabilities in the virtual simulation environment are realized and cross-platform OpenCL simulation is supported.
Smart Images

Figure CN118885221A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital simulation technology, and in particular to an OpenCL digital simulation method and system. Background Art
[0002] OpenCL (Open Computing Language) is an open, royalty-free standard for cross-platform parallel programming of various accelerators in supercomputers, cloud servers, personal computers, mobile devices, and embedded platforms.
[0003] Currently, there is no method that supports OpenCL simulation on the digital simulation platform; OpenCL code cannot be simulated and tested directly on the simulation platform, and OpenCL's behavior and performance cannot be verified under different hardware or software configurations.
[0004] Patent document CN116010037A discloses a GPU simulation method based on a virtual simulation platform, including: the encoding subsystem participates in the compilation and operation of the target machine program, and encodes its API and corresponding parameters by replacing the original OpenGL / OpenCL and other graphics standard specification libraries, and writes them into the corresponding memory space. The pipeline subsystem captures the encoded API data and sends it to the decoding subsystem through the corresponding IPC communication technology. The decoding subsystem decodes and executes the received data. If the API needs to return a value, the result of the API execution will be returned to the encoding subsystem through the pipeline subsystem. However, the patent only provides the simulation of the GPU through the pipeline subsystem, IPC communication, and socket, and does not involve OpenCL simulation and the specific method of directly using API forwarding in OpenCL simulation. Summary of the invention
[0005] In view of the defects in the prior art, the object of the present invention is to provide an OpenCL digital simulation method and system.
[0006] The OpenCL digital simulation method provided by the present invention includes: Step 1: Create a virtual OpenCL driver library; Step 2: Use the virtual OpenCL driver library to replace the OpenCL driver library referenced by the application by default, and relink the OpenCL application using the development tools of the target machine to be virtualized; Step 3: Create a virtual OpenCL interface forwarding library; Step 4: Integrate the virtual OpenCL interface forwarding library in the virtual machine. The virtual OpenCL driver library completes the execution of the function that triggers the virtual OpenCL interface forwarding library by filling in the virtual machine and reads the execution result, thereby completing the parallel computing mechanism processing based on task partitioning and data partitioning on the physical device of the host machine.
[0007] Preferably, the step 1 comprises: Step 1.1: Create an API interface for the virtual OpenCL driver library based on the OpenCL standard; Step 1.2: Write the functions of the virtual OpenCL driver library for all the API interfaces used; Step 1.3: Fill in the data structure of the function of the virtual OpenCL driver library, including the number of parameters passed into the API function, the parameters of the API function, and the return value structure pointer; Step 1.4: Use the development tool chain of the target machine to be virtualized to compile all the functions of the virtual OpenCL driver library of the API interface into a virtual OpenCL driver library.
[0008] Preferably, the step 3 comprises: Step 3.1: Read the data structure of the API interface of the virtual OpenCL driver library, including the API function index value, the number of parameters passed into the API function, and each parameter of the API function; Step 3.2: Use the API function index value as the key of the hash table to directly index the OpenCL driver library on the host machine and find the corresponding function in the OpenCL driver library on the host machine; Step 3.3: Fill in the data structure of the API interface of the virtual OpenCL driver library and run the corresponding function in the OpenCL driver library on the host machine, and put the return value of the calculation result into the specified position in the corresponding data structure; Step 3.4: Use the development tool chain of the target machine to be virtualized to compile all the functions in steps 3.1 to 3.3 into an OpenCL interface forwarding library, and generate a link library that can be referenced in the virtual OpenCL driver library.
[0009] Preferably, the task segmentation includes: In the OpenCL driver library, task division is achieved by writing multiple kernel functions, each of which performs different computing tasks; Use different command queues to execute tasks in parallel, with tasks in each command queue executed on different computing units of the device; Allows tasks to be scheduled and synchronized at different times, submits tasks through the clEnqueueNDRangeKernel function, and uses events to manage synchronization and dependencies.
[0010] Preferably, the data segmentation includes: In the OpenCL driver library, data segmentation is achieved by dividing the data into multiple work items and work groups. Each work item processes a fragment of the data, and a work group is a collection of work items. The OpenCL driver library provides multiple memory types to support data segmentation. Each work item reads and writes data and stores it in the corresponding memory area. Each work item calculates the data fragment to be processed based on its index, and uses the get_global_id() and get_local_id() functions to determine the global and local indexes of the work item, thereby deciding the data to be processed.
[0011] The OpenCL digital simulation system provided by the present invention includes: Module M1: Create a virtual OpenCL driver library; Module M2: Use the virtual OpenCL driver library to replace the OpenCL driver library referenced by the application by default, and relink the OpenCL application using the development tools of the target machine to be virtualized; Module M3: Make a virtual OpenCL interface forwarding library; Module M4: Integrate the virtual OpenCL interface forwarding library in the virtual machine. The virtual OpenCL driver library completes the execution of the function that triggers the virtual OpenCL interface forwarding library by filling in the virtual machine and reads the execution result, thereby completing the parallel computing mechanism processing based on task partitioning and data partitioning on the physical device of the host machine.
[0012] Preferably, the module M1 comprises: Module M1.1: Create an API interface for a virtual OpenCL driver library based on the OpenCL standard; Module M1.2: Write functions of the virtual OpenCL driver library for all used API interfaces; Module M1.3: Fill the data structure of the function of the virtual OpenCL driver library, including the number of parameters passed into the API function, the parameters of the API function, and the return value structure pointer; Module M1.4: Use the development tool chain of the target machine to be virtualized to compile all the functions of the virtual OpenCL driver library of the API interface into a virtual OpenCL driver library.
[0013] Preferably, the module M3 comprises: Module M3.1: reads the data structure of the API interface of the virtual OpenCL driver library, including the API function index value, the number of parameters passed into the API function, and each parameter of the API function; Module M3.2: Use the API function index value as the key of the hash table to directly index the OpenCL driver library on the host machine and find the corresponding function in the OpenCL driver library on the host machine; Module M3.3: Fill the data structure of the API interface of the virtual OpenCL driver library and run the corresponding function in the OpenCL driver library on the host machine, and put the return value of the calculation result into the specified position in the corresponding data structure; Module M3.4: Use the development tool chain of the target machine to be virtualized to compile all functions in modules M3.1 to M3.3 into an OpenCL interface forwarding library, and generate a link library that can be referenced in the virtual OpenCL driver library.
[0014] Preferably, the task segmentation includes: In the OpenCL driver library, task division is achieved by writing multiple kernel functions, each of which performs different computing tasks; Use different command queues to execute tasks in parallel, with tasks in each command queue executed on different computing units of the device; Allows tasks to be scheduled and synchronized at different times, submits tasks through the clEnqueueNDRangeKernel function, and uses events to manage synchronization and dependencies.
[0015] Preferably, the data segmentation includes: In the OpenCL driver library, data segmentation is achieved by dividing the data into multiple work items and work groups. Each work item processes a fragment of the data, and a work group is a collection of work items. The OpenCL driver library provides multiple memory types to support data segmentation. Each work item reads and writes data and stores it in the corresponding memory area. Each work item calculates the data fragment to be processed based on its index, and uses the get_global_id() and get_local_id() functions to determine the global and local indexes of the work item, thereby deciding the data to be processed.
[0016] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides an OpenCL digital simulation method, which can, without changing the source program of the client application, provide a simulated OpenCL library, so that the client application can relink the OpenCL driver library of the host machine and run in a specified virtual machine, thereby achieving the ability to obtain efficient parallel computing mechanism processing in a virtual simulation environment and cross-platform implementation. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings: Figure 1 This is a flow chart of the OpenCL digital simulation method of the present invention. DETAILED DESCRIPTION
[0018] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0019] Example 1 like Figure 1 The present invention provides an OpenCL digital simulation method, comprising the following steps: Step 1: Create a virtual OpenCL driver library; Step 1.1: The API interface of the virtual OpenCL driver library to be created complies with the OpenCL standard; Step 1.2: Write the functions of the virtual OpenCL driver library for all the API interfaces used; An example of a virtual OpenCL driver library that obtains platform information: void callClGetPlatformIDs(clGetPlatformIDsParams *params); The actual OpenCL function called: clGetPlatformIDs Description: Get a list of OpenCL platform IDs on the system.
[0020] prototype: cl_int clGetPlatformIDs( cl_uint num_entries, / / Number of platform IDs to obtain cl_platform_id *platforms, / / array for receiving platform ID cl_uint *num_platforms / / The actual number of platforms obtained ); Step 1.3: Fill in the data structure of the function of the virtual OpenCL driver library: including the number of parameters passed into the API function, each parameter of the API function, and the return value structure pointer.
[0021] / / Define a structure to save information about API calls typedef struct { cl_uint num_args; / / The number of parameters passed into the function cl_uint num_entries; / / Number of platform IDs to obtain cl_platform_id *platforms; / / array for receiving platform ID cl_uint *num_platforms; / / The actual number of platforms obtained cl_int return_code; / / function return value } clGetPlatformIDsParams; Step 1.4: Use the development tool chain of the target machine to be virtualized to compile all the API interface functions in steps 1.2 and 1.3 into a virtual OpenCL driver library.
[0022] 1. Design the structure of the virtual driver library First, determine the functionality and interface of the virtual OpenCL driver library. The virtual driver library usually simulates the actual OpenCL driver behavior for testing or development purposes.
[0023] Structural design Interface: defines the OpenCL function interface to be implemented by the virtual driver library.
[0024] Implementation: The specific implementation of these functions can be a simulation of functions such as clGetPlatformIDs.
[0025] Header file: contains function declarations and necessary data structure definitions.
[0026] Implementation file: actual function implementation.
[0027] 2. Implementing a virtual driver library Header and source files that implement the virtual library.
[0028] 3. Compile the virtual driver library Compile into a shared library using gcc On Linux systems, you can use gcc to compile the above code into a shared library (.so file). The following is an example command: gcc -shared -o libvirtual_opencl.so -fPIC virtual_opencl.c Step 2: Relink the OpenCL application running on the virtual machine; Step 2.1: Use the virtual OpenCL driver library generated in step 1 to replace the OpenCL driver library referenced by the application by default; Step 2.2: Use the development tools of the target machine to be virtualized to relink the OpenCL application. Because the OpenCL driver library has been replaced in step 2.1, the relinked OpenCL application contains the virtual OpenCL driver; Step 3: Create a virtual OpenCL interface forwarding library; Step 3.1: Read the data structure of the virtual OpenCL driver library interface: including the API function index value, the number of parameters passed into the API function, and each parameter of the API function; Step 3.2: Use the API function index value as the key of the hash table to directly index the OpenCL driver library on the host machine, so as to quickly find the corresponding function in the host machine's OpenCL driver library; Step 3.3: Fill in the parameters of step 3.1 and run the OpenCL driver function on the host machine, and put the return value of the calculation result into the specified position in the corresponding data structure; Step 3.4: Use the development tool chain of the target machine to be virtualized to compile all the functions in Step 3.1, Step 3.2, and Step 3.3 into an OpenCL interface forwarding library, and generate a link library that can be referenced in the virtual OpenCL driver library; 1. Design the structure of the virtual OpenCL interface forwarding library First, determine the functionality and interface of the virtual OpenCL interface forwarding library. A virtual driver library usually simulates the actual OpenCL driver behavior for testing or development purposes.
[0029] Structural design Interface: defines the OpenCL function interface to be implemented by the virtual OpenCL interface forwarding library.
[0030] Implementation: The concrete implementation of these functions.
[0031] Header file: contains function declarations and necessary data structure definitions.
[0032] Implementation file: actual function implementation.
[0033] 2. Implementing a virtual driver library Header and source files that implement the virtual library.
[0034] 3. Compile the virtual driver library Compile into a shared library using gcc On Linux systems, you can use gcc to compile the above code into a shared library (.so file). The following is an example command: gcc -shared -o libvirtual_opencl.so -fPIC virtual_opencl.c Step 4: Integrate the virtual OpenCL interface forwarding library in step 3 into the virtual machine. The virtual OpenCL driver library triggers the operation of the virtual OpenCL forwarding interface function by filling in the virtual machine, and reads the operation result of the forwarding interface function, thereby completing the parallel computing mechanism processing based on task partitioning and data partitioning on the physical device of the host machine.
[0035] The specific processes of task segmentation and data segmentation are: 1. Task-Based Parallelism concept: Task splitting is the process of breaking down computational work into independent tasks, each of which can be processed in parallel. These tasks are usually independent of each other and can be executed simultaneously on different computing units.
[0036] Application in OpenCL: Kernel function: In OpenCL, task division is usually achieved by writing multiple kernel functions, each of which performs different computing tasks.
[0037] Queue management: Using different command queues, these tasks can be executed in parallel. Tasks in each command queue can be executed on different computing units of the device.
[0038] Scheduling and synchronization: OpenCL allows tasks to be scheduled and synchronized at different times, submitting tasks through the clEnqueueNDRangeKernel function and using events to manage synchronization and dependencies.
[0039] Example: Suppose we have an image processing program that needs to perform multiple different processing steps (such as blurring, sharpening, edge detection). We can write different kernels for each processing step and submit and execute them as independent tasks in OpenCL.
[0040] 2. Data-Based Parallelism concept: Data segmentation is to decompose the computational data into multiple parts and perform the same operation on these data parts in parallel. This method is particularly suitable for scenarios where the same computation needs to be performed on large data sets.
[0041] Application in OpenCL: Work-Items and Work-Groups: In OpenCL, data partitioning is achieved by dividing the data into multiple work-items and work-groups. Each work-item processes a piece of data, and a work-group is a collection of work-items.
[0042] Memory model: OpenCL provides multiple memory types (such as global memory, local memory, constant memory) to support data partitioning. Each work item can read and write data, and these data can be stored in the appropriate memory area.
[0043] Index calculation: Each work item usually calculates the piece of data to be processed based on its index. For example, you can use get_global_id() and get_local_id() to determine the global and local indexes of the work item, and thus determine the data it should process.
[0044] Example: Consider a matrix multiplication operation. We can divide the matrix into small blocks, and each work item is responsible for calculating the partial product of a matrix block. In this way, large-scale data operations can be completed in parallel on multiple processing units, significantly improving computational efficiency.
[0045] Summarize Task splitting: suitable for breaking down a computing task into multiple independent tasks, each of which can be executed in parallel on different computing units. Often used in scenarios where different operations need to be performed.
[0046] Data segmentation: suitable for breaking down data into multiple parts, each of which is processed by the same operation. It is often used in scenarios where large-scale data processing and parallel computing are required.
[0047] Example 2 The present invention also provides an OpenCL digital simulation system, which can be implemented by executing the process steps of the OpenCL digital simulation method, that is, those skilled in the art can understand the OpenCL digital simulation method as a preferred implementation of the OpenCL digital simulation system.
[0048] The OpenCL digital simulation system provided by the present invention includes: module M1: making a virtual OpenCL driver library; module M2: using the virtual OpenCL driver library to replace the OpenCL driver library referenced by the application by default, and relinking the OpenCL application using the development tool of the target machine to be virtualized; module M3: making a virtual OpenCL interface forwarding library; module M4: integrating the virtual OpenCL interface forwarding library in the virtual machine, the virtual OpenCL driver library completes the operation of the function that triggers the virtual OpenCL interface forwarding library by filling in the virtual machine, and reads the operation result, thereby completing the parallel computing mechanism processing based on task division and data division on the physical device of the host machine.
[0049] The module M1 includes: module M1.1: making an API interface of a virtual OpenCL driver library according to the OpenCL standard; module M1.2: writing functions of the virtual OpenCL driver library of all used API interfaces; module M1.3: filling the data structure of the functions of the virtual OpenCL driver library, including the number of parameters passed in by the API function, the various parameters of the API function and the return value structure pointer; module M1.4: using the development tool chain of the target machine to be virtualized, compiling the functions of the virtual OpenCL driver library of all API interfaces into a virtual OpenCL driver library.
[0050] The module M3 includes: module M3.1: reading the data structure of the API interface of the virtual OpenCL driver library, including the API function index value, the number of parameters passed into the API function and the various parameters of the API function; module M3.2: using the API function index value as the key of the hash table, directly indexing the OpenCL driver library on the host machine, and finding the corresponding function in the host machine OpenCL driver library; module M3.3: filling the data structure of the API interface of the virtual OpenCL driver library and running the corresponding function in the OpenCL driver library on the host machine, and placing the return value of the calculation result in the specified position in the corresponding data structure; module M3.4: using the development tool chain of the target machine to be virtualized to compile all functions in modules M3.1 to modules M3.3 into an OpenCL interface forwarding library, and generate a link library that can be referenced in the virtual OpenCL driver library.
[0051] The task splitting includes: in the OpenCL driver library, implementing task splitting by writing multiple kernel functions, each kernel function performs different computing tasks; using different command queues to execute tasks in parallel, and the tasks in each command queue are executed on different computing units of the device; allowing tasks to be scheduled and synchronized at different times, submitting tasks through the clEnqueueNDRangeKernel function, and using events to manage synchronization and dependencies.
[0052] The data segmentation includes: in the OpenCL driver library, data segmentation is achieved by dividing the data into multiple work items and work groups, each work item processes a fragment of the data, and the work group is a collection of work items; the OpenCL driver library provides multiple memory types to support data segmentation, each work item reads and writes data, and stores it in a corresponding memory area; each work item calculates the data fragment to be processed according to its index, and uses get_global_id() and get_local_id() functions to determine the global and local indexes of the work item, thereby determining the data to be processed.
[0053] Those skilled in the art know that, in addition to implementing the system, device and its various modules provided by the present invention in a purely computer-readable program code, it is entirely possible to implement the same program in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded microcontrollers by logically programming the method steps. Therefore, the system, device and its various modules provided by the present invention can be considered as a hardware component, and the modules included therein for implementing various programs can also be considered as structures within the hardware component; the modules for implementing various functions can also be considered as both software programs for implementing the method and structures within the hardware component.
[0054] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. An OpenCL digital simulation method, characterized in that: include: Step 1: Create a virtual OpenCL driver library; Step 2: Use the virtual OpenCL driver library to replace the OpenCL driver library referenced by the application by default, and relink the OpenCL application using the development tools of the target machine to be virtualized; Step 3: Create a virtual OpenCL interface forwarding library; Step 4: Integrate the virtual OpenCL interface forwarding library in the virtual machine. The virtual OpenCL driver library completes the execution of the function that triggers the virtual OpenCL interface forwarding library by filling in the virtual machine and reads the execution result, thereby completing the parallel computing mechanism processing based on task partitioning and data partitioning on the physical device of the host machine.
2. The OpenCL digital simulation method according to claim 1, characterized in that: The step 1 comprises: Step 1.1: Create an API interface for the virtual OpenCL driver library based on the OpenCL standard; Step 1.2: Write the functions of the virtual OpenCL driver library for all the API interfaces used; Step 1.3: Fill in the data structure of the function of the virtual OpenCL driver library, including the number of parameters passed into the API function, the parameters of the API function, and the return value structure pointer; Step 1.4: Use the development tool chain of the target machine to be virtualized to compile all the functions of the virtual OpenCL driver library of the API interface into a virtual OpenCL driver library.
3. The OpenCL digital simulation method according to claim 1, characterized in that: The step 3 comprises: Step 3.1: Read the data structure of the API interface of the virtual OpenCL driver library, including the API function index value, the number of parameters passed into the API function, and each parameter of the API function; Step 3.2: Use the API function index value as the key of the hash table to directly index the OpenCL driver library on the host machine and find the corresponding function in the OpenCL driver library on the host machine; Step 3.3: Fill in the data structure of the API interface of the virtual OpenCL driver library and run the corresponding function in the OpenCL driver library on the host machine, and put the return value of the calculation result into the specified position in the corresponding data structure; Step 3.4: Use the development tool chain of the target machine to be virtualized to compile all the functions in steps 3.1 to 3.3 into an OpenCL interface forwarding library, and generate a link library that can be referenced in the virtual OpenCL driver library.
4. The OpenCL digital simulation method according to claim 1, characterized in that: The task segmentation includes: In the OpenCL driver library, task division is achieved by writing multiple kernel functions, each of which performs different computing tasks; Use different command queues to execute tasks in parallel, with tasks in each command queue executed on different computing units of the device; Allows tasks to be scheduled and synchronized at different times, submits tasks through the clEnqueueNDRangeKernel function, and uses events to manage synchronization and dependencies.
5. The OpenCL digital simulation method according to claim 1, characterized in that: The data segmentation includes: In the OpenCL driver library, data segmentation is achieved by dividing the data into multiple work items and work groups. Each work item processes a fragment of the data, and a work group is a collection of work items. The OpenCL driver library provides multiple memory types to support data segmentation. Each work item reads and writes data and stores it in the corresponding memory area. Each work item calculates the data fragment to be processed based on its index, and uses the get_global_id() and get_local_id() functions to determine the global and local indexes of the work item, thereby deciding the data to be processed.
6. An OpenCL digital simulation system, characterized in that: include: Module M1: Create a virtual OpenCL driver library; Module M2: Use the virtual OpenCL driver library to replace the OpenCL driver library referenced by the application by default, and relink the OpenCL application using the development tools of the target machine to be virtualized; Module M3: Make a virtual OpenCL interface forwarding library; Module M4: Integrate the virtual OpenCL interface forwarding library in the virtual machine. The virtual OpenCL driver library completes the execution of the function that triggers the virtual OpenCL interface forwarding library by filling in the virtual machine and reads the execution result, thereby completing the parallel computing mechanism processing based on task partitioning and data partitioning on the physical device of the host machine.
7. The OpenCL digital simulation system according to claim 6, characterized in that: The module M1 comprises: Module M1.1: Create an API interface for a virtual OpenCL driver library based on the OpenCL standard; Module M1.2: Write functions of the virtual OpenCL driver library for all used API interfaces; Module M1.3: Fill the data structure of the function of the virtual OpenCL driver library, including the number of parameters passed into the API function, the parameters of the API function, and the return value structure pointer; Module M1.4: Use the development tool chain of the target machine to be virtualized to compile all the functions of the virtual OpenCL driver library of the API interface into a virtual OpenCL driver library.
8. The OpenCL digital simulation system according to claim 6, characterized in that: The module M3 comprises: Module M3.1: reads the data structure of the API interface of the virtual OpenCL driver library, including the API function index value, the number of parameters passed into the API function, and each parameter of the API function; Module M3.2: Use the API function index value as the key of the hash table to directly index the OpenCL driver library on the host machine and find the corresponding function in the OpenCL driver library on the host machine; Module M3.3: Fill the data structure of the API interface of the virtual OpenCL driver library and run the corresponding function in the OpenCL driver library on the host machine, and put the return value of the calculation result into the specified position in the corresponding data structure; Module M3.4: Use the development tool chain of the target machine to be virtualized to compile all functions in modules M3.1 to M3.3 into an OpenCL interface forwarding library, and generate a link library that can be referenced in the virtual OpenCL driver library.
9. The OpenCL digital simulation system according to claim 6, characterized in that: The task segmentation includes: In the OpenCL driver library, task division is achieved by writing multiple kernel functions, each of which performs different computing tasks; Use different command queues to execute tasks in parallel, with tasks in each command queue executed on different computing units of the device; Allows tasks to be scheduled and synchronized at different times, submits tasks through the clEnqueueNDRangeKernel function, and uses events to manage synchronization and dependencies.
10. The OpenCL digital simulation system according to claim 6, characterized in that: The data segmentation includes: In the OpenCL driver library, data segmentation is achieved by dividing the data into multiple work items and work groups. Each work item processes a fragment of the data, and a work group is a collection of work items. The OpenCL driver library provides multiple memory types to support data segmentation. Each work item reads and writes data and stores it in the corresponding memory area. Each work item calculates the data fragment to be processed based on its index, and uses the get_global_id() and get_local_id() functions to determine the global and local indexes of the work item, thereby deciding the data to be processed.
Citation Information
Patent Citations
GPU simulation method and system based on virtual simulation platform
CN116010037A
Simulation and integration method and system of GPU supporting OpenGL
CN116308990A
KR20200037968A
