Task scheduling method of GPU (graphics processing Unit) multiprocessor systemTechnical Field
The invention belongs to the field of electronics, and relates to a task scheduling method of a GPU (graphics processing unit) multiprocessor system.
Background
Currently, a plurality of processors are generally used as a system for data processing in a GPU, and a task scheduling method of a GPU multiprocessor system is required in order to exert the functions of all the processors and adapt to different working modes (high performance mode — low power consumption mode) of the GPU.
Disclosure of Invention
The invention aims to provide a task scheduling method of a GPU multiprocessor system, which can schedule the GPU multiprocessor system according to a GPU working mode and ensure the normal operation of the system.
The technical solution of the invention is as follows:
a task scheduling method of a GPU multiprocessor system comprises the following steps:
(1) the following bit segments are provided to the user: the processor comprises a simple-complex mode selection bit, a high-performance-low-power-consumption mode selection bit, a processor starting number bit, current busy-idle state bits of all processors, and starting-closing positions of all processors, wherein a processor user can configure the simple-complex mode selection bit, the high-performance-low-power-consumption mode selection bit and the processor starting number bit by configuring a high bit section;
(2) task scheduling method initialization
(2-1) when the simple-complex mode selection bit is set to be a simple mode, the GPU multiprocessor system is bypassed, the current busy-idle state bits of all processors are set to be idle, and the opening-closing positions of all processors are set to be closed;
(2-2) when the simple-complex mode selection bit is set to be a complex mode, the high-performance-low-power-consumption mode selection bit is set to be a high-performance mode, the opening-closing positions of all processors are set to be opened, and the current busy-idle state bits of all processors are idle;
(2-3) when the simple-complex mode selection bit is set to be the complex mode, the high-performance-low power consumption mode selection bit is set to be the low power consumption mode, and the setting of the starting number bits of the processors is completed, at the moment, the GPU multiprocessor system only sets the current starting-closing state bits of the starting number bits of the processors to be started, and the current starting-closing state bits of the other processors are set to be closed;
(3) task scheduling, when a processor usage request is received,
(3-1) if the setting mode is as in (2-1), the processor use request is not sent to the processor and is directly sent to the next-stage module;
(3-2) if the mode is set as in (2-2), when a processor use request is received, performing task mapping in a high-performance mode, firstly inquiring current busy-idle state bits of all processors, and when the first current busy-idle state bit is found to be an idle processor, sending data to the processor, and then setting the current busy-idle state bit of the processor to be busy; if all processors are busy at present-the idle state bit is busy, waiting for a period to continue inquiring; when a signal of finishing the calculation of the processor is received, setting the current busy-idle state bit of the register to be idle;
(3-3) if the mode is set as in (2-3), when a processor use request is received, performing task mapping in a low power consumption mode, firstly inquiring current busy-idle state bits of all open state processors, if any processor with a current busy-idle state bit being idle is found, sending data to the processor, then setting the current busy-idle state bit of the processor to be busy, if all open processors are busy, inquiring whether the processor with the current open-close state bit being close state exists, if not, waiting for a period to continue inquiring, and if so, setting the open-close state bit of the processor to be open, and setting the current busy-idle state bit of the processor to be busy; when a processor count complete signal is received, the current busy-idle status bit of this register is set to idle.
The invention has the advantages that:
the performance of all processors can be exerted, the working conditions of the GPU in different working modes (high-performance mode-low-power-consumption mode) are adapted, the situation that as few processors as possible participate in processing operation in the low-power-consumption mode is guaranteed, and as many processors as possible participate in processing operation in the high-performance mode is guaranteed.
Drawings
Fig. 1 is a block diagram of a task scheduling method of a GPU multiprocessor system.
Detailed Description
The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings and the specific embodiments. It is obvious that the described embodiments are only a part of the embodiments of the present invention, rather than the whole embodiments, and that all other embodiments, which can be derived by a person skilled in the art without inventive step based on the embodiments of the present invention, belong to the scope of protection of the present invention.
As shown in fig. 1, a task scheduling method of a GPU multiprocessor system is characterized by comprising 3 steps: user configuration, task scheduling method initialization, task scheduling, and providing the following bit segments to the user: the method comprises the following steps of (1) selecting a simple-complex mode (determining that a current system works in a simple or complex mode), selecting a high-performance-low-power mode (determining that the current system works in the high-performance-low-power mode), starting a processor number (determining how many processors the current system can be started at most), currently busy-idle state bits (indicating whether all processors are currently used or not), starting-closing states (indicating whether the processors are currently started or not) of all processors, and configuring a processor user by configuring a bit section to enable a task scheduling module to work under the condition of user needs, wherein the scheduling method comprises the following working steps:
(1) the user configures simple-complex mode selection bits, high-performance-low power consumption mode selection bits and processor starting number bits;
(2) the task scheduling method is initialized, i.e.
1) When the simple-complex mode selection bit is set to be a simple mode, the GPU multiprocessor system is bypassed, the current busy-idle state bits of all the processors are set to be idle, and the opening-closing positions of all the processors are set to be closed;
2) when the simple-complex mode selection bit is set to be a complex mode, the high-performance-low-power-consumption mode selection bit is set to be a high-performance mode, the opening-closing positions of all processors are set to be opened, and the current busy-idle state bits of all processors are idle;
3) when the simple-complex mode selection bit is set to be the complex mode, the high-performance-low power consumption mode selection bit is set to be the low power consumption mode, and the setting of the starting number bits of the processors is completed, at the moment, the GPU multiprocessor system only sets the current starting-closing state bits of the starting number bits of the processors to be started, and sets the current starting-closing state bits of the other processors to be closed;
(3) task scheduling, i.e. when a processor usage request is received,
1) if the setting mode is 2-1, the processor use request is not sent to the processor and is directly sent to the next set of modules;
2) if the mode is set as 2-2, when a processor use request is received, task mapping in a high-performance mode is carried out, namely current busy-idle state bits of all processors are firstly inquired, when the first current busy-idle state bit is found to be an idle processor, data are sent to the processors, and then the current busy-idle state bits of the processors are set to be busy; if all processors are busy at present-the idle state bit is busy, waiting for a period to continue inquiring; when a signal of finishing the calculation of the processor is received, setting the current busy-idle state bit of the register to be idle;
3) if the mode is set as 2-3, when a processor use request is received, task mapping in a low power consumption mode is carried out, namely, current busy-idle state bits of all open state processors are firstly inquired, if any processor with the current busy-idle state bit being idle is found, data are sent to the processor, then the current busy-idle state bit of the processor is set to be busy, if the current busy-idle state bits of all open processors are busy, whether the processor with the current open-close state bit being close state exists is inquired, if not, a period is waited for continuous inquiry, if yes, the open-close state bit of the processor is set to be open, and the current busy-idle state bit of the processor is set to be busy; when a processor count complete signal is received, the current busy-idle status bit of this register is set to idle.