Skip to content

Commit

Permalink
Base Toolkit 2022.1 support, minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-v-gorshkov committed Jan 20, 2022
1 parent ad0e144 commit e6a4ada
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 54 deletions.
18 changes: 9 additions & 9 deletions SOFTWARE
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
level-zero-loader:
deb:
- https://github.com/oneapi-src/level-zero/releases/download/v1.6.2/level-zero_1.6.2+u18.04_amd64.deb
- https://github.com/oneapi-src/level-zero/releases/download/v1.6.2/level-zero-devel_1.6.2+u18.04_amd64.deb
- https://github.com/oneapi-src/level-zero/releases/download/v1.7.9/level-zero_1.7.9+u18.04_amd64.deb
- https://github.com/oneapi-src/level-zero/releases/download/v1.7.9/level-zero-devel_1.7.9+u18.04_amd64.deb
compute-runtime:
deb:
- https://github.com/intel/compute-runtime/releases/download/21.45.21574/intel-gmmlib_21.2.1_amd64.deb
- https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.8744/intel-igc-core_1.0.8744_amd64.deb
- https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.8744/intel-igc-opencl_1.0.8744_amd64.deb
- https://github.com/intel/compute-runtime/releases/download/21.45.21574/intel-opencl-icd_21.45.21574_amd64.deb
- https://github.com/intel/compute-runtime/releases/download/21.45.21574/intel-level-zero-gpu_1.2.21574_amd64.deb
- https://github.com/intel/compute-runtime/releases/download/22.02.22151/intel-gmmlib_22.0.0_amd64.deb
- https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.9933/intel-igc-core_1.0.9933_amd64.deb
- https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.9933/intel-igc-opencl_1.0.9933_amd64.deb
- https://github.com/intel/compute-runtime/releases/download/22.02.22151/intel-opencl-icd_22.02.22151_amd64.deb
- https://github.com/intel/compute-runtime/releases/download/22.02.22151/intel-level-zero-gpu_1.2.22151_amd64.deb
metrics-discovery:
github:
build_path: build
Expand All @@ -18,7 +18,7 @@ metrics-discovery:
- sudo make install
- sudo make package
- sudo dpkg -i *.deb
commit: 8334347b2e61c339e1118680938470172dd38cb4
commit: 0bb7d238bb64dada396f6958b4ab47bb13455610
url: https://github.com/intel/metrics-discovery
metrics-library:
github:
Expand All @@ -42,7 +42,7 @@ oneapit-toolkits:
apt_repo: deb https://apt.repos.intel.com/oneapi all main
apt_source: /etc/apt/sources.list.d/oneAPI.list
packages:
- intel-basekit=2021.4.0-3422
- intel-basekit=2022.1.1-119
finalize:
config:
commands:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.42.5
0.43.0
2 changes: 1 addition & 1 deletion build_utils/get_cl_tracing_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import build_utils

url = "https://github.com/intel/compute-runtime.git"
commit = "faea7915c2047aaf463c24c1a6904a1c4af1c1c4"
commit = "7968823b3c96cd65552b9752bb1ae5b1e1acaa45"

def postprocess(file_path):
input = open(file_path, "rt")
Expand Down
2 changes: 1 addition & 1 deletion build_utils/get_gmm_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import build_utils

url = "https://github.com/intel/gmmlib.git"
commit = "9253eb8b949515d2a5030f99163a35567fe81838"
commit = "c239ff1d7c87017b4a73e8b7a3dcad53d8ab840c"

def main():
if len(sys.argv) < 3:
Expand Down
2 changes: 1 addition & 1 deletion build_utils/get_iga_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import build_utils

url = "https://github.com/intel/intel-graphics-compiler.git"
commit = "3ba8dde8c414a0e47df58b1bba12a64f8ba2089e"
commit = "373eb7767186f0d185f249cfee7014b756130d54"

def main():
if len(sys.argv) < 3:
Expand Down
2 changes: 1 addition & 1 deletion build_utils/get_igc_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import build_utils

url = "https://github.com/intel/intel-graphics-compiler.git"
commit = "3ba8dde8c414a0e47df58b1bba12a64f8ba2089e"
commit = "373eb7767186f0d185f249cfee7014b756130d54"

def main():
if len(sys.argv) < 3:
Expand Down
2 changes: 1 addition & 1 deletion build_utils/get_itt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import build_utils

url = "https://github.com/intel/ittapi.git"
commit = "b59e826cc3feac1aa545542727c37ea0347e8230"
commit = "3a19f624f6f9754237de0068c95fbaf0c255616f"

def main():
if len(sys.argv) < 3:
Expand Down
2 changes: 1 addition & 1 deletion build_utils/get_md_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import build_utils

url = "https://github.com/intel/metrics-discovery.git"
commit = "8334347b2e61c339e1118680938470172dd38cb4"
commit = "0bb7d238bb64dada396f6958b4ab47bb13455610"

def main():
if len(sys.argv) < 3:
Expand Down
2 changes: 1 addition & 1 deletion build_utils/get_ze_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import build_utils

url = "https://github.com/oneapi-src/level-zero.git"
commit = "7afa8a6dda56d4baef950c0a9d5ef8d8b0e14c4e"
commit = "78f08cc338d70ac60a8f61084ad194fa0dbc90b0"

def main():
if len(sys.argv) < 3:
Expand Down
3 changes: 3 additions & 0 deletions samples/cl_gemm_itt/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ static void Compute(cl_device_id device, const std::vector<float>& a,
}

int main(int argc, char* argv[]) {
utils::SetEnv("INTEL_LIBITTNOTIFY32", "1");
utils::SetEnv("INTEL_LIBITTNOTIFY64", "1");

cl_device_type type = CL_DEVICE_TYPE_GPU;
if (argc > 1 && strcmp(argv[1], "cpu") == 0) {
type = CL_DEVICE_TYPE_CPU;
Expand Down
28 changes: 10 additions & 18 deletions samples/dpc_info/main.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>

#include <CL/sycl.hpp>

Expand Down Expand Up @@ -50,7 +51,7 @@ int main(int argc, char* argv[]) {
list_mode = true;
}

sycl::vector_class<sycl::platform> platforms =
std::vector<sycl::platform> platforms =
sycl::platform::get_platforms();

if (list_mode) {
Expand All @@ -59,7 +60,7 @@ int main(int argc, char* argv[]) {
platforms[pl_id].get_info<sycl::info::platform::name>();
std::cout << "Platform #" << pl_id << ": " << name << std::endl;

sycl::vector_class<sycl::device> devices =
std::vector<sycl::device> devices =
platforms[pl_id].get_devices(sycl::info::device_type::all);

for (size_t device_id = 0; device_id < devices.size(); device_id++) {
Expand Down Expand Up @@ -88,15 +89,6 @@ int main(int argc, char* argv[]) {
platform.get_info<sycl::info::platform::profile>();
std::cout << std::setw(TEXT_WIDTH) << std::left <<
TAB + "Platform Profile " << profile << std::endl;

sycl::vector_class<std::string> extensions =
platform.get_info<sycl::info::platform::extensions>();
std::cout << std::setw(TEXT_WIDTH) << std::left <<
TAB + "Platform Extensions ";
for (auto extenton : extensions) {
std::cout << extenton << " ";
}
std::cout << std::endl << std::endl;
}

for (auto platform : platforms) {
Expand All @@ -105,7 +97,7 @@ int main(int argc, char* argv[]) {
std::cout << std::setw(TEXT_WIDTH) << std::left <<
TAB + "Platform Name " << name << std::endl;

sycl::vector_class<sycl::device> devices =
std::vector<sycl::device> devices =
platform.get_devices(sycl::info::device_type::all);
std::cout << std::setw(TEXT_WIDTH) << std::left <<
"Number of devices " << devices.size() << std::endl;
Expand Down Expand Up @@ -258,21 +250,21 @@ int main(int argc, char* argv[]) {
TAB + "printf() buffer size" << printf_buffer_size << " (" <<
ConvertBytesToString(printf_buffer_size) << ")" << std::endl;

sycl::vector_class<std::string> built_in_kernels =
std::vector<std::string> built_in_kernels =
device.get_info<sycl::info::device::built_in_kernels>();
std::cout << std::setw(TEXT_WIDTH) << std::left <<
TAB + "Built-in kernels ";
for (auto kernel : built_in_kernels) {
std::cout << kernel << " ";
for (size_t i = 0; i < built_in_kernels.size(); ++i) {
std::cout << built_in_kernels[i] << " ";
}
std::cout << std::endl;

sycl::vector_class<std::string> device_extensions =
std::vector<std::string> device_extensions =
device.get_info<sycl::info::device::extensions>();
std::cout << std::setw(TEXT_WIDTH) << std::left <<
TAB + "Device Extensions ";
for (auto device_extension : device_extensions) {
std::cout << device_extension << " ";
for (size_t i = 0; i < device_extensions.size(); ++i) {
std::cout << device_extensions[i] << " ";
}
std::cout << std::endl << std::endl;
}
Expand Down
25 changes: 13 additions & 12 deletions tools/onetrace/unified_tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ class UnifiedTracer {
static UnifiedTracer* Create(const TraceOptions& options) {
cl_device_id cl_cpu_device = utils::cl::GetIntelDevice(CL_DEVICE_TYPE_CPU);
cl_device_id cl_gpu_device = utils::cl::GetIntelDevice(CL_DEVICE_TYPE_GPU);
if (cl_cpu_device == nullptr && cl_gpu_device == nullptr) {
std::cerr << "[WARNING] Intel OpenCL devices are not found" << std::endl;
return nullptr;
}

UnifiedTracer* tracer = new UnifiedTracer(options);
PTI_ASSERT(tracer != nullptr);
Expand Down Expand Up @@ -135,6 +131,7 @@ class UnifiedTracer {
if (ze_kernel_collector == nullptr &&
cl_cpu_kernel_collector == nullptr &&
cl_gpu_kernel_collector == nullptr) {
std::cerr << "[WARNING] Unable to trace anything" << std::endl;
delete tracer;
return nullptr;
}
Expand Down Expand Up @@ -200,7 +197,9 @@ class UnifiedTracer {
return nullptr;
}

ClExtCollector::Create(cl_cpu_api_collector, cl_gpu_api_collector);
if (cl_gpu_api_collector != nullptr || cl_cpu_api_collector != nullptr) {
ClExtCollector::Create(cl_cpu_api_collector, cl_gpu_api_collector);
}
}

return tracer;
Expand Down Expand Up @@ -238,15 +237,17 @@ class UnifiedTracer {
delete ze_api_collector_;
}

if (cl_cpu_kernel_collector_ != nullptr) {
delete cl_cpu_kernel_collector_;
}
if (cl_gpu_kernel_collector_ != nullptr) {
delete cl_gpu_kernel_collector_;
if (cl_cpu_kernel_collector_ != nullptr ||
cl_gpu_kernel_collector_ != nullptr) {
if (cl_cpu_kernel_collector_ != nullptr) {
delete cl_cpu_kernel_collector_;
}
if (cl_gpu_kernel_collector_ != nullptr) {
delete cl_gpu_kernel_collector_;
}
ClExtCollector::Destroy();
}

ClExtCollector::Destroy();

if (CheckOption(TRACE_LOG_TO_FILE)) {
std::cerr << "[INFO] Log was stored to " <<
options_.GetLogFileName() << std::endl;
Expand Down
19 changes: 12 additions & 7 deletions utils/cl_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
namespace utils {
namespace cl {

inline std::string GetDeviceVendor(cl_device_id device) {
char vendor[MAX_STR_SIZE] = { 0 };
cl_int status = clGetDeviceInfo(
device, CL_DEVICE_VENDOR, MAX_STR_SIZE, vendor, nullptr);
PTI_ASSERT(status == CL_SUCCESS);
return vendor;
}

inline std::vector<cl_device_id> GetDeviceList(cl_device_type type) {
cl_int status = CL_SUCCESS;

Expand Down Expand Up @@ -49,7 +57,9 @@ inline std::vector<cl_device_id> GetDeviceList(cl_device_type type) {
PTI_ASSERT(status == CL_SUCCESS);

for (cl_uint j = 0; j < device_count; ++j) {
result.push_back(device_list[j]);
if (GetDeviceVendor(device_list[j]).find("Intel") != std::string::npos) {
result.push_back(device_list[j]);
}
}
}

Expand Down Expand Up @@ -90,16 +100,11 @@ inline void ReleaseSubDeviceList(
}

inline cl_device_id GetIntelDevice(cl_device_type type) {
cl_int status = CL_SUCCESS;
cl_device_id target = nullptr;
char vendor[MAX_STR_SIZE] = { 0 };

std::vector<cl_device_id> device_list = GetDeviceList(type);
for (auto device : device_list) {
status = clGetDeviceInfo(
device, CL_DEVICE_VENDOR, MAX_STR_SIZE, vendor, nullptr);
PTI_ASSERT(status == CL_SUCCESS);
if (strstr(vendor, "Intel") != nullptr) {
if (GetDeviceVendor(device).find("Intel") != std::string::npos) {
target = device;
break;
}
Expand Down

0 comments on commit e6a4ada

Please sign in to comment.