Skip to content

Commit

Permalink
Changes and bug fixes
Browse files Browse the repository at this point in the history
1. Changed testsuite to hiptesuite
2. Update messages during clone
3. Take make target for samples and use target for hipInfo
4. Fixed wrong string output in Kokkos
5. Removed openmpi cloning and building for laghos.

Change-Id: I462d1c288dd2e39a572544eb6feeeac87b2e3420
  • Loading branch information
rupamc-amd authored and mohanmithur committed Oct 30, 2021
1 parent 6fc3425 commit 8c4f685
Show file tree
Hide file tree
Showing 112 changed files with 216 additions and 307 deletions.
5 changes: 0 additions & 5 deletions cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,5 @@
"repo_url": "https://github.com/CEED/Laghos.git",
"branch": None,
"commit_id": "a7f6123d42847f6bdbdb614f5af876541f49cd16"
},
"openmpi": {
"repo_url": "http://github.com/open-mpi/ompi.git openmpi",
"branch": "v4.0.x",
"commit_id": "4dc196d8c60aadeb34b0df9d226ab4c341004704"
}
}
4 changes: 2 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
sys.path.append(os.path.join(os.path.dirname(__file__), "src"))


from testsuite.TestersExecutor import TestersExecutor
from testsuite.list_tests import list_tests
from hiptestsuite.TestersExecutor import TestersExecutor
from hiptestsuite.list_tests import list_tests
import cfg


Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions src/testsuite/Test.py → src/hiptestsuite/Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
# THE SOFTWARE.

from typing import List, Union, Set, Dict
from testsuite.AMD import AMDObject
from testsuite.targets import Target
from hiptestsuite.AMD import AMDObject
from hiptestsuite.targets import Target
from enum import Enum, auto
from testsuite.test_classifier import TestClassifier
from testsuite.config_processor import ConfigProcessor
from hiptestsuite.test_classifier import TestClassifier
from hiptestsuite.config_processor import ConfigProcessor


class Test(AMDObject):
def __init__(self):
# Cycle Import
from testsuite.TesterRepository import Tester
from hiptestsuite.TesterRepository import Tester

AMDObject.__init__(self)
self.test_name: Union[None, str] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from testsuite.Test import Test, TestData, GetTestsData, LogLocation, Quick
from testsuite.test_classifier import TestClassifier
from testsuite.AMD import AMDObject
from testsuite.config_processor import ConfigProcessor
from testsuite.match_fun_args_call import match_fun_args_call
import testsuite
from hiptestsuite.Test import Test, TestData, GetTestsData, LogLocation, Quick
from hiptestsuite.test_classifier import TestClassifier
from hiptestsuite.AMD import AMDObject
from hiptestsuite.config_processor import ConfigProcessor
from hiptestsuite.match_fun_args_call import match_fun_args_call
import hiptestsuite

from typing import List, Union
import pkgutil
Expand Down Expand Up @@ -54,7 +54,7 @@ def clean(self):
class TesterRepository(AMDObject):
def __init__(self):
AMDObject.__init__(self)
self.getTestersFrom = [testsuite]
self.getTestersFrom = [hiptestsuite]
self.testers: Union[None, List[Tester]] = None

def getTesters(self) -> List[Tester]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from testsuite.TesterRepository import TesterRepository, Tester, Test
from testsuite.test_selector import TestSelector
from testsuite.config_processor import ConfigProcessor
from testsuite.Test import TestResult
from hiptestsuite.TesterRepository import TesterRepository, Tester, Test
from hiptestsuite.test_selector import TestSelector
from hiptestsuite.config_processor import ConfigProcessor
from hiptestsuite.Test import TestResult

import os
import traceback
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from testsuite.test_classifier import TestClassifier
from hiptestsuite.test_classifier import TestClassifier

from typing import Union

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from testsuite.TesterRepository import Tester, Test, TestData
from testsuite.Test import HIPTestData, TestResult, HIP_PLATFORM
from hiptestsuite.TesterRepository import Tester, Test, TestData
from hiptestsuite.Test import HIPTestData, TestResult, HIP_PLATFORM
from typing import Union, List
from testsuite.test_classifier import TestClassifier
from testsuite.applications.cuda_grep.cuda_grep_build_amd import BuildRunAmd
from testsuite.applications.cuda_grep.cuda_grep_build_nvidia import BuildRunNvidia
from testsuite.common.hip_get_packages import HipPackages
from testsuite.common.hip_shell import execshellcmd
from hiptestsuite.test_classifier import TestClassifier
from hiptestsuite.applications.cuda_grep.cuda_grep_build_amd import BuildRunAmd
from hiptestsuite.applications.cuda_grep.cuda_grep_build_nvidia import BuildRunNvidia
from hiptestsuite.common.hip_get_packages import HipPackages
from hiptestsuite.common.hip_shell import execshellcmd

import os
import re
Expand All @@ -35,7 +35,7 @@ def __init__(self, cwd, binary):
self.cwdAbs = cwd
self.binary = binary
self.app_path = os.path.join(self.cwdAbs,\
"src/testsuite/applications/cuda_grep/")
"src/hiptestsuite/applications/cuda_grep/")
self.app_root = os.path.join(self.app_path, "CUDA-grep/")
self.thistestpath = self.app_root
self.prepareobj = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# THE SOFTWARE.

import os
from testsuite.common.hip_shell import execshellcmd
from testsuite.applications.cuda_grep.cuda_grep_parser_common import CudaGrepParser
from hiptestsuite.common.hip_shell import execshellcmd
from hiptestsuite.applications.cuda_grep.cuda_grep_parser_common import CudaGrepParser

class BuildRunAmd():
def __init__(self, thistestpath, logFile, binary):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# THE SOFTWARE.

import os
from testsuite.common.hip_shell import execshellcmd
from testsuite.applications.cuda_grep.cuda_grep_parser_common import CudaGrepParser
from hiptestsuite.common.hip_shell import execshellcmd
from hiptestsuite.applications.cuda_grep.cuda_grep_parser_common import CudaGrepParser

class BuildRunNvidia():
def __init__(self, thistestpath, logFile, binary):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from testsuite.common.hip_shell import execshellcmd
from hiptestsuite.common.hip_shell import execshellcmd

class CudaGrepParser():
def __init__(self, results):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from testsuite.TesterRepository import Tester, Test, TestData
from testsuite.Test import HIPTestData, TestResult, HIP_PLATFORM
from hiptestsuite.TesterRepository import Tester, Test, TestData
from hiptestsuite.Test import HIPTestData, TestResult, HIP_PLATFORM
from typing import Union, List
from testsuite.test_classifier import TestClassifier
from testsuite.applications.cuda_memtest.cuda_memtest_build_amd import BuildRunAmd
from testsuite.applications.cuda_memtest.cuda_memtest_build_nvidia import BuildRunNvidia
from testsuite.common.hip_get_packages import HipPackages
from testsuite.common.hip_shell import execshellcmd
from hiptestsuite.test_classifier import TestClassifier
from hiptestsuite.applications.cuda_memtest.cuda_memtest_build_amd import BuildRunAmd
from hiptestsuite.applications.cuda_memtest.cuda_memtest_build_nvidia import BuildRunNvidia
from hiptestsuite.common.hip_get_packages import HipPackages
from hiptestsuite.common.hip_shell import execshellcmd

import os
import re
Expand All @@ -35,7 +35,7 @@ def __init__(self, cwd, binary):
self.cwdAbs = cwd
self.binary = binary
self.app_path = os.path.join(self.cwdAbs,\
"src/testsuite/applications/cuda_memtest/")
"src/hiptestsuite/applications/cuda_memtest/")
self.app_root = os.path.join(self.app_path, "cuda_memtest/")
self.thistestpath = self.app_root
self.prepareobj = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# THE SOFTWARE.

import os
from testsuite.common.hip_shell import execshellcmd
from testsuite.applications.cuda_memtest.cuda_memtest_parser_common import CudaMemtestParser
from hiptestsuite.common.hip_shell import execshellcmd
from hiptestsuite.applications.cuda_memtest.cuda_memtest_parser_common import CudaMemtestParser

class BuildRunAmd():
def __init__(self, thistestpath, logFile, binary):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# THE SOFTWARE.

import os
from testsuite.common.hip_shell import execshellcmd
from testsuite.applications.cuda_memtest.cuda_memtest_parser_common import CudaMemtestParser
from hiptestsuite.common.hip_shell import execshellcmd
from hiptestsuite.applications.cuda_memtest.cuda_memtest_parser_common import CudaMemtestParser

class BuildRunNvidia():
def __init__(self, thistestpath, logFile, binary):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from testsuite.common.hip_shell import execshellcmd
from hiptestsuite.common.hip_shell import execshellcmd
import re

class CudaMemtestParser():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from testsuite.TesterRepository import Tester, Test, TestData
from testsuite.Test import HIPTestData, TestResult, HIP_PLATFORM
from hiptestsuite.TesterRepository import Tester, Test, TestData
from hiptestsuite.Test import HIPTestData, TestResult, HIP_PLATFORM
from typing import Union, List
from testsuite.test_classifier import TestClassifier
from testsuite.applications.hip_examples.hip_examples_build_amd import BuildRunAmd
from testsuite.applications.hip_examples.hip_examples_build_nvidia import BuildRunNvidia
from testsuite.common.hip_get_packages import HipPackages
from testsuite.common.hip_shell import *
from hiptestsuite.test_classifier import TestClassifier
from hiptestsuite.applications.hip_examples.hip_examples_build_amd import BuildRunAmd
from hiptestsuite.applications.hip_examples.hip_examples_build_nvidia import BuildRunNvidia
from hiptestsuite.common.hip_get_packages import HipPackages
from hiptestsuite.common.hip_shell import *

import os

Expand All @@ -34,7 +34,7 @@ class PrepareTest():
def __init__(self, path, cwd):
self.cwdAbs = cwd
self.appPath = os.path.join(self.cwdAbs,\
"src/testsuite/applications/hip_examples/")
"src/hiptestsuite/applications/hip_examples/")
self.examplepath = os.path.join(self.appPath, "HIP-Examples/")
self.thistestpath = os.path.join(self.examplepath, path)
self.prepareobj = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
# THE SOFTWARE.

import os
from testsuite.applications.hip_examples.hip_examples_parser import Hip_examples_parser
from testsuite.applications.hip_examples.hip_examples_build_common import BuildRunCommon
from testsuite.common.hip_shell import *
from hiptestsuite.applications.hip_examples.hip_examples_parser import Hip_examples_parser
from hiptestsuite.applications.hip_examples.hip_examples_build_common import BuildRunCommon
from hiptestsuite.common.hip_shell import *

class BuildRunAmd(BuildRunCommon):
def __init__(self, path):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import os
import tempfile

from testsuite.applications.hip_examples.hip_examples_parser import Hip_examples_parser
from testsuite.common.hip_shell import *
from hiptestsuite.applications.hip_examples.hip_examples_parser import Hip_examples_parser
from hiptestsuite.common.hip_shell import *

class BuildRunCommon():
'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

import os

from testsuite.applications.hip_examples.hip_examples_parser import Hip_examples_parser
from testsuite.applications.hip_examples.hip_examples_build_common import BuildRunCommon
from testsuite.common.hip_shell import *
from hiptestsuite.applications.hip_examples.hip_examples_parser import Hip_examples_parser
from hiptestsuite.applications.hip_examples.hip_examples_build_common import BuildRunCommon
from hiptestsuite.common.hip_shell import *

class BuildRunNvidia(BuildRunCommon):
def __init__(self, path):
self.hippath = os.path.join(os.getcwd(),"src/testsuite/conformance/HIP/")
self.hippath = os.path.join(os.getcwd(),"src/hiptestsuite/conformance/HIP/")
BuildRunCommon.__init__(self, path)

def getenvironmentvariables(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

from testsuite.TesterRepository import Tester, Test, TestData
from testsuite.Test import HIPTestData, TestResult, HIP_PLATFORM
from hiptestsuite.TesterRepository import Tester, Test, TestData
from hiptestsuite.Test import HIPTestData, TestResult, HIP_PLATFORM
from typing import Union, List
from testsuite.test_classifier import TestClassifier
from testsuite.applications.hip_samples.hip_samples_build_amd import BuildRunAmd
from testsuite.applications.hip_samples.hip_samples_build_nvidia import BuildRunNvidia
from testsuite.common.hip_get_packages import HipPackages
from testsuite.common.hip_shell import execshellcmd
from hiptestsuite.test_classifier import TestClassifier
from hiptestsuite.applications.hip_samples.hip_samples_build_amd import BuildRunAmd
from hiptestsuite.applications.hip_samples.hip_samples_build_nvidia import BuildRunNvidia
from hiptestsuite.common.hip_get_packages import HipPackages
from hiptestsuite.common.hip_shell import execshellcmd

import os
import re
# Common class to clone, set up, build and run test
class PrepareTest():
def __init__(self, path, binary, cwd):
self.cwdAbs = cwd
self.conformancePath = os.path.join(self.cwdAbs, "src/testsuite/conformance/")
self.conformancePath = os.path.join(self.cwdAbs, "src/hiptestsuite/conformance/")
self.hippath = os.path.join(self.conformancePath, "HIP/")
self.thistestpath = os.path.join(self.hippath, path)
self.binary = binary
Expand Down Expand Up @@ -61,7 +61,7 @@ def downloadtest(self, logFile):
self.hipcommitId, "HIP")
return ret

def buildtest(self, logFile, platform):
def buildtest(self, logFile, platform, target=None):
isBinaryPresent = True
if platform == HIP_PLATFORM.nvidia:
self.prepareobj = BuildRunNvidia(self.thistestpath, logFile)
Expand All @@ -70,7 +70,7 @@ def buildtest(self, logFile, platform):
else:
print("Invalid Platform")
return False
self.prepareobj.buildtest()
self.prepareobj.buildtest(target)

if not os.path.isfile(\
os.path.join(self.thistestpath, self.binary)):
Expand Down Expand Up @@ -1275,7 +1275,7 @@ def test(self, test_data: HIPTestData):
if not res:
test_data.test_result = TestResult.FAIL
return
res = self.buildtest(testLogger, test_data.HIP_PLATFORM)
res = self.buildtest(testLogger, test_data.HIP_PLATFORM, "hipInfo")
if not res:
test_data.test_result = TestResult.FAIL
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@
# THE SOFTWARE.

import os
from testsuite.common.hip_shell import execshellcmd
from testsuite.applications.hip_samples.hip_samples_build_common import BuildRunCommon
from hiptestsuite.common.hip_shell import execshellcmd
from hiptestsuite.applications.hip_samples.hip_samples_build_common import BuildRunCommon

class BuildRunAmd(BuildRunCommon):
def __init__(self, path, logfile):
BuildRunCommon.__init__(self, path, logfile)

def buildtest(self):
def buildtest(self, target):
# In this function put the build steps for test cases
# which differ across platforms (amd/nvidia/intel) else
# invoke BuildRunCommon.buildtest
if not os.path.exists("/opt/rocm"):
print("ROCm not installed. Exiting!")
return False
ret = BuildRunCommon.buildtest(self)
ret = BuildRunCommon.buildtest(self, target)
return ret
Loading

0 comments on commit 8c4f685

Please sign in to comment.