This PR solves the problem of getting the wrong local work group sizes when the device is changed from the CPU using the OpenCL backend to the GPU using the SPIR-V backend.
Problem description
The problem was that, in the SPIR-V backend, once the number of blocks is computed, is then stored in the TaskMetaData object. However, while the global work size for the same task will not change, there is no guarantee that the local work group size is the same. This patch solves the issue by resetting the local work size only when the device is updated.
Backend/s tested
Mark the backends affected by this PR.
[X] OpenCL
[X] PTX
[X] SPIRV
OS tested
Mark the OS where this PR is tested.
[X] Linux
[ ] OSx
[ ] Windows
Did you check on FPGAs?
If it is applicable, check your changes on FPGAs.
[ ] Yes
[X] No
How to test the new patch?
The use case for this is the task-migration in Client/Server setup:
## Run Server in one terminal
./runServer.sh
## Client in another terminal
./runClient.sh ## Change device during runtime
## Note: the application selects the backend 0:0 (default backend)
# type different <backend:deviceNumber> version from the client.
# Examples:
# 0:1
# 1:0
## etc
Description
This PR solves the problem of getting the wrong local work group sizes when the device is changed from the CPU using the OpenCL backend to the GPU using the SPIR-V backend.
Problem description
The problem was that, in the SPIR-V backend, once the number of blocks is computed, is then stored in the
TaskMetaData
object. However, while the global work size for the same task will not change, there is no guarantee that the local work group size is the same. This patch solves the issue by resetting the local work size only when the device is updated.Backend/s tested
Mark the backends affected by this PR.
OS tested
Mark the OS where this PR is tested.
Did you check on FPGAs?
If it is applicable, check your changes on FPGAs.
How to test the new patch?
The use case for this is the task-migration in Client/Server setup:
https://github.com/jjfumero/tornadovm-examples?tab=readme-ov-file#live-task-migration-client-server-app