Skip to content

Commit

Permalink
try fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fnrizzi committed Nov 18, 2023
1 parent c60716d commit f0af467
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/unit_test/TestDeviceAndThreads.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import unittest
import subprocess
import psutil

PREFIX = "$<TARGET_FILE_DIR:Kokkos_CoreUnitTest_DeviceAndThreads>"
EXECUTABLE = "$<TARGET_FILE_NAME:Kokkos_CoreUnitTest_DeviceAndThreads>"
Expand All @@ -30,7 +31,9 @@ def GetFlag(flag, *extra_args):
return int(p.stdout)

def GetNumThreads(max_threads):
for x in [1, 2, 4, 6, 8]:
phys_cores_count = psutil.cpu_count(logical=False)
looplist = [1] + [i*phys_cores_count for i in [1,2,3,4,5,6,7]]
for x in looplist:
if x >= max_threads:
break
yield x
Expand Down

0 comments on commit f0af467

Please sign in to comment.