Skip to content

Commit

Permalink
Corrections of VBA code in "GpuCpu_SingleDouble_PerformanceTest": if …
Browse files Browse the repository at this point in the history
…the device was not found the releasing of objects should be avoided.
  • Loading branch information
Excel-lent committed Aug 7, 2023
1 parent 1b2e15e commit afe507a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion C#/Installation script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Name: "{app}\demo\cl"; Permissions: everyone-full
Source: bin\ClooWrapperVBA.dll; DestDir: {app}; Flags: ignoreversion recursesubdirs overwritereadonly; Permissions: everyone-full;
Source: bin\ClooWrapperVBA_x64.dll; DestDir: {app}; Flags: ignoreversion recursesubdirs overwritereadonly; Permissions: everyone-full;
Source: bin\Cloo.dll; DestDir: {app}; Flags: ignoreversion recursesubdirs overwritereadonly; Permissions: everyone-full;
Source: ..\Excel\OpenCl v0.04.xlsm; DestDir: {app}\demo; Flags: ignoreversion recursesubdirs overwritereadonly; Permissions: everyone-full;
Source: ..\Excel\OpenCl v0.05.xlsm; DestDir: {app}\demo; Flags: ignoreversion recursesubdirs overwritereadonly; Permissions: everyone-full;
Source: ..\Excel\cl\Performance.cl; DestDir: {app}\demo\cl; Flags: ignoreversion recursesubdirs overwritereadonly; Permissions: everyone-full;
Source: ..\Excel\cl\MatrixMultiplication.cl; DestDir: {app}\demo\cl; Flags: ignoreversion recursesubdirs overwritereadonly; Permissions: everyone-full;
Source: ..\Excel\Configuration.vbs; DestDir: {app}\demo; Flags: ignoreversion recursesubdirs overwritereadonly; Permissions: everyone-full;
Expand Down
20 changes: 10 additions & 10 deletions Excel/Performance.bas
Original file line number Diff line number Diff line change
Expand Up @@ -205,26 +205,26 @@ Sub GpuCpu_SingleDouble_PerformanceTest()
Set programDevice_Performance = GetFirstDeviceOfType(progDevices, "GPU")
wsPerformanceTest.Cells(4, 5) = GPU_PerformanceTest_Single(upper, singles, aSingle, programDevice_Performance)
wsPerformanceTest.Cells(4, 6) = GPU_PerformanceTest_Double(upper, doubles, aDouble, programDevice_Performance)

result = programDevice_Performance.ReleaseMemObject(1)
result = programDevice_Performance.ReleaseMemObject(0)
result = programDevice_Performance.ReleaseKernel
result = programDevice_Performance.ReleaseProgram
End If

result = programDevice_Performance.ReleaseMemObject(1)
result = programDevice_Performance.ReleaseMemObject(0)
result = programDevice_Performance.ReleaseKernel
result = programDevice_Performance.ReleaseProgram

If GetFirstDeviceOfType(progDevices, "CPU") Is Nothing Then
wsPerformanceTest.Cells(3, 5) = CVErr(2042)
wsPerformanceTest.Cells(3, 6) = CVErr(2042)
Else
Set programDevice_Performance = GetFirstDeviceOfType(progDevices, "CPU")
wsPerformanceTest.Cells(3, 5) = CPU_PerformanceTest_Single(upper, singles, aSingle, programDevice_Performance)
wsPerformanceTest.Cells(3, 6) = CPU_PerformanceTest_Double(upper, doubles, aDouble, programDevice_Performance)

result = programDevice_Performance.ReleaseMemObject(1)
result = programDevice_Performance.ReleaseMemObject(0)
result = programDevice_Performance.ReleaseKernel
result = programDevice_Performance.ReleaseProgram
End If

result = programDevice_Performance.ReleaseMemObject(1)
result = programDevice_Performance.ReleaseMemObject(0)
result = programDevice_Performance.ReleaseKernel
result = programDevice_Performance.ReleaseProgram
End Sub

' Single precision performance at GPU.
Expand Down

0 comments on commit afe507a

Please sign in to comment.