Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 8 additions & 33 deletions .github/scripts/tests/therock_configure_ci_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,46 +151,21 @@ def test_docs_only_change_returns_empty_list(self, mock_run):
project_to_run = therock_configure_ci.retrieve_projects(args)
self.assertEqual(len(project_to_run), 0)

@patch("therock_configure_ci.get_modified_paths")
def test_linux_only_subtrees_returns_empty_list(self, mock_get_modified):
@patch("subprocess.run")
def test_linux_only_subtrees_returns_empty_list(self, mock_run):
args = {
"is_pull_request": True,
"base_ref": "HEAD^",
"platform": "windows",
"platform": "windows"
}

mock_get_modified.return_value = [
"projects/rocprofiler-compute/src/compute.cpp",
"projects/rccl/src/rccl.cpp",
"projects/amdsmi/src/amdsmi.cpp",
"projects/rocprofiler-register/src/register.cpp",
"projects/amdsmi/hello/test.cpp",
"projects/hipother/hello/test.cpp",
]

project_to_run = therock_configure_ci.retrieve_projects(args)
self.assertEqual(len(project_to_run), 0)

@patch("therock_configure_ci.get_modified_paths")
def test_linux_only_subtrees_returns_correct_list(self, mock_get_modified):
args = {
"is_pull_request": True,
"base_ref": "HEAD^",
"platform": "windows",
}

mock_get_modified.return_value = [
"projects/rocprofiler-compute/src/compute.cpp",
"projects/rccl/src/rccl.cpp",
"projects/amdsmi/src/amdsmi.cpp",
"projects/rocprofiler-register/src/register.cpp",
"projects/amdsmi/hello/test.cpp",
"projects/hip/src/hip.cpp", # contains windows CI trigger
"projects/clr/src/hip.cpp", # contains windows CI trigger
]
# Mock git diff to return only below paths
mock_process = MagicMock()
mock_process.stdout = "projects/rocprofiler-compute/src/compute.cpp\nprojects/rccl/src/rccl.cpp\nprojects/amdsmi/src/amdsmi.cpp\nprojects/rocprofiler-register/src/register.cpp\nprojects/amdsmi/hello/test.cpp"
mock_run.return_value = mock_process

project_to_run = therock_configure_ci.retrieve_projects(args)
self.assertEqual(len(project_to_run), 1)
self.assertEqual(len(project_to_run), 0)

if __name__ == "__main__":
unittest.main()
19 changes: 6 additions & 13 deletions .github/scripts/therock_configure_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import json
import logging
import subprocess
from therock_matrix import subtree_to_project_map, project_map, trigger_windows_ci_for_subtrees_paths
from therock_matrix import subtree_to_project_map, project_map, linux_only_subtrees_paths
import time
from typing import Mapping, Optional, Iterable
import os
Expand Down Expand Up @@ -81,14 +81,6 @@ def check_for_workflow_file_related_to_ci(paths: Optional[Iterable[str]]) -> boo
return any(is_path_workflow_file_related_to_ci(p) for p in paths)


def check_trigger_windows_ci_for_subtree_path(path):
"""Returns true if path matches any of matches windows ci subtree patterns"""
for windows_ci_subtree_patterns in trigger_windows_ci_for_subtrees_paths:
if fnmatch.fnmatch(path, windows_ci_subtree_patterns):
return True
return False


# Paths matching any of these patterns are considered to have no influence over
# build or test workflows so any related jobs can be skipped if all paths
# modified by a commit/PR match a pattern in this list.
Expand Down Expand Up @@ -159,10 +151,11 @@ def retrieve_projects(args):
if related_to_therock_ci:
subtrees = list(subtree_to_project_map.keys())

# If the platform is windows and any modified paths do not require windows CI based on "trigger_windows_ci_for_subtrees_paths", we skip windows CI
if args.get("platform") == "windows" and not any(check_trigger_windows_ci_for_subtree_path(path) for path in modified_paths):
logging.info("Modified subtrees do not contain windows CI subtrees paths, skipping windows CI")
return []
# If the platform is windows and the modified path is a "linux_only_subtrees", we skip the windows CI
for linux_only_subtree_pattern in linux_only_subtrees_paths:
if args.get("platform") == "windows" and any(fnmatch.fnmatch(modified_path, linux_only_subtree_pattern) for modified_path in modified_paths):
logging.info("Modified subtrees contain linux-only subtrees, skipping CI on windows")
return []

projects = set()
# collect the associated subtree to project
Expand Down
10 changes: 5 additions & 5 deletions .github/scripts/therock_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
},
}

trigger_windows_ci_for_subtrees_paths = [
"projects/clr/*",
"projects/hip/*",
"projects/hip-tests/*",
"projects/rocr-runtime/*",
linux_only_subtrees_paths = [
# TODO(#3475): Remove linux only subtrees when rocprofiler supports Windows
"projects/rocprofiler*/*",
"projects/rccl/*",
"projects/amdsmi/*"
]
3 changes: 3 additions & 0 deletions projects/amdsmi/include/amd_smi/impl/amd_smi_drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
#include <unistd.h>

#include <vector>
#include <memory>
#include <mutex> // NOLINT
#include <string>

#include "amd_smi/amdsmi.h"
#include "amd_smi/impl/amd_smi_lib_loader.h"
#include "amd_smi/impl/amdgpu_drm.h"
#include "amd_smi/impl/xf86drm.h"
#include "amd_smi/impl/scoped_fd.h"

namespace amd::smi {

Expand Down
9 changes: 9 additions & 0 deletions projects/amdsmi/include/amd_smi/impl/amdgpu_drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,15 @@ struct drm_amdgpu_info_uq_metadata {
#define AMDGPU_FAMILY_GC_11_5_0 150 /* GC 11.5.0 */
#define AMDGPU_FAMILY_GC_12_0_0 152 /* GC 12.0.0 */

/* FIXME wrong namespace! */
struct drm_color_ctm_3x4 {
/*
* Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
* (not two's complement!) format.
*/
__u64 matrix[12];
};
Comment thread
arvindcheru marked this conversation as resolved.

#if defined(__cplusplus)
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion projects/amdsmi/include/amd_smi/impl/xf86drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#ifndef _XF86DRM_H_
#define _XF86DRM_H_

#include <cstdarg>
#include <stdarg.h>
#include <sys/types.h>
#include <cstdint>
#ifndef __LIBDRM__
Expand Down
13 changes: 8 additions & 5 deletions projects/amdsmi/src/amd_smi/amd_smi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
* THE SOFTWARE.
*/

#include <cassert>
#include <cerrno>
#include <assert.h>
#include <errno.h>
#include <sys/utsname.h>
#include <cstdio>
#include <cstring>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>

#include <cstdlib>
Expand All @@ -35,17 +35,19 @@
#include <sstream>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <memory>
#include <limits>
#include <functional>
#include <exception>

#include "config/amd_smi_config.h"
#include "amd_smi/amdsmi.h"
#include "amd_smi/impl/scoped_fd.h"
#include "amd_smi/impl/fdinfo.h"
#include "amd_smi/impl/amd_smi_common.h"
#include "amd_smi/impl/amd_smi_cper.h"
#include "amd_smi/impl/amd_smi_system.h"
Expand All @@ -64,6 +66,7 @@
#include "amd_smi/impl/amd_smi_utils.h"
#include "amd_smi/impl/amd_smi_processor.h"
#include "rocm_smi/rocm_smi.h"
#include "rocm_smi/rocm_smi_common.h"
#include "rocm_smi/rocm_smi_logger.h"
#include "rocm_smi/rocm_smi_utils.h"
#include "rocm_smi/rocm_smi_kfd.h"
Expand Down
2 changes: 1 addition & 1 deletion projects/amdsmi/src/amd_smi/amd_smi_drm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
#include <dirent.h>
#include <fcntl.h>
#include <unistd.h>
#include <cstring>
#include <memory>
#include <regex>
#include "config/amd_smi_config.h"
#include "amd_smi/impl/amd_smi_drm.h"
#include "amd_smi/impl/amd_smi_utils.h"
#include "amd_smi/impl/xf86drm.h"
#include "impl/scoped_fd.h"
#include "rocm_smi/rocm_smi.h"
#include "rocm_smi/rocm_smi_main.h"
Expand Down
13 changes: 7 additions & 6 deletions projects/amdsmi/src/amd_smi/amd_smi_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
* THE SOFTWARE.
*/

#include <climits>
#include <limits.h>
#include <sys/ioctl.h>
#include <libdrm/amdgpu.h>
#include <libdrm/drm.h>
#include <fcntl.h>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <ctime>
#include <time.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/types.h>
Expand All @@ -41,13 +41,14 @@
#include <iostream>
#include <iterator>
#include <memory>
#include <random>
#include <regex>
#include <sstream>

#include "config/amd_smi_config.h"
#include "amd_smi/impl/amd_smi_utils.h"
#include "amd_smi/impl/scoped_fd.h"
#include "amd_smi/impl/amd_smi_system.h"
#include "shared_mutex.h" // NOLINT
#include "rocm_smi/rocm_smi_logger.h"
#include "rocm_smi/rocm_smi_utils.h"

Expand Down
4 changes: 1 addition & 3 deletions projects/clr/hipamd/src/hip_memory.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2015 - 2026 Advanced Micro Devices, Inc.
/* Copyright (c) 2015 - 2025 Advanced Micro Devices, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -209,7 +209,6 @@ hipError_t hipDestroyExternalMemory(hipExternalMemory_t extMem) {
hipError_t hipImportExternalSemaphore(hipExternalSemaphore_t* extSem_out,
const hipExternalSemaphoreHandleDesc* semHandleDesc) {
HIP_INIT_API(hipImportExternalSemaphore, extSem_out, semHandleDesc);
CHECK_STREAM_CAPTURE_SUPPORTED();
if (extSem_out == nullptr || semHandleDesc == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
Expand Down Expand Up @@ -309,7 +308,6 @@ hipError_t hipWaitExternalSemaphoresAsync(const hipExternalSemaphore_t* extSemAr

hipError_t hipDestroyExternalSemaphore(hipExternalSemaphore_t extSem) {
HIP_INIT_API(hipDestroyExternalSemaphore, extSem);
CHECK_STREAM_CAPTURE_SUPPORTED();
if (extSem == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
Expand Down
22 changes: 14 additions & 8 deletions projects/clr/rocclr/device/pal/palcounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,14 +666,20 @@ static constexpr std::array<std::pair<int, int>, 140> gfx10BlockIdPal = {{
}};

void PerfCounter::convertInfo() {
if (dev().properties().gfxTriple.major < 12) {
if (info_.blockIndex_ < gfx10BlockIdPal.size()) {
auto p = gfx10BlockIdPal[info_.blockIndex_];
info_.blockIndex_ = std::get<0>(p);
info_.counterIndex_ = std::get<1>(p);
}
} else {
Unimplemented();
switch (dev().ipLevel()) {
case Pal::GfxIpLevel::GfxIp10_1:
case Pal::GfxIpLevel::GfxIp10_3:
case Pal::GfxIpLevel::GfxIp11_0:
case Pal::GfxIpLevel::GfxIp11_5:
if (info_.blockIndex_ < gfx10BlockIdPal.size()) {
auto p = gfx10BlockIdPal[info_.blockIndex_];
info_.blockIndex_ = std::get<0>(p);
info_.counterIndex_ = std::get<1>(p);
}
break;
default:
Unimplemented();
break;
}

assert(info_.blockIndex_ < blockIdToIndexSelect.size());
Expand Down
Loading
Loading