Skip to content

Commit

Permalink
fix editorconfig check format issue
Browse files Browse the repository at this point in the history
  • Loading branch information
arthw committed Jul 13, 2024
1 parent 4cd9e48 commit 74e3185
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
34 changes: 17 additions & 17 deletions ggml/src/ggml-sycl/sycl_hw.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#include "sycl_hw.hpp"

bool is_in_vector(const std::vector<int> &vec, int item) {
return std::find(vec.begin(), vec.end(), item) != vec.end();
}

SYCL_HW_FAMILY get_device_family(sycl::device *device_ptr) {
auto id = device_ptr->get_info<sycl::ext::intel::info::device::device_id>();
auto id_prefix = id & 0xff00;

if (is_in_vector(Xe_Iris_IDs, id_prefix) or is_in_vector(UHD_IDs, id_prefix)) {
return SYCL_HW_FAMILY_INTEL_IGPU;
} else {
std::cerr << "No support PCI_ID: " << std::hex << id << std::endl;
return SYCL_HW_FAMILY_UNKNOWN;
}
}
#include "sycl_hw.hpp"

bool is_in_vector(const std::vector<int> &vec, int item) {
return std::find(vec.begin(), vec.end(), item) != vec.end();
}

SYCL_HW_FAMILY get_device_family(sycl::device *device_ptr) {
auto id = device_ptr->get_info<sycl::ext::intel::info::device::device_id>();
auto id_prefix = id & 0xff00;

if (is_in_vector(Xe_Iris_IDs, id_prefix) or is_in_vector(UHD_IDs, id_prefix)) {
return SYCL_HW_FAMILY_INTEL_IGPU;
} else {
std::cerr << "No support PCI_ID: " << std::hex << id << std::endl;
return SYCL_HW_FAMILY_UNKNOWN;
}
}
48 changes: 24 additions & 24 deletions ggml/src/ggml-sycl/sycl_hw.hpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#ifndef SYCL_HW_HPP
#define SYCL_HW_HPP

#include <algorithm>
#include <stdio.h>
#include <vector>


#include <sycl/sycl.hpp>

// const int Xe_ARC[] = {0x5600, 0x4f};
const std::vector<int> Xe_Iris_IDs = {0x4900, 0xa700};
const std::vector<int> UHD_IDs = {0x4600};

enum SYCL_HW_FAMILY {
SYCL_HW_FAMILY_UNKNOWN = -1,
SYCL_HW_FAMILY_INTEL_IGPU = 0
};

bool is_in_vector(std::vector<int> &vec, int item);

SYCL_HW_FAMILY get_device_family(sycl::device *device_ptr);

#endif // SYCL_HW_HPP
#ifndef SYCL_HW_HPP
#define SYCL_HW_HPP

#include <algorithm>
#include <stdio.h>
#include <vector>


#include <sycl/sycl.hpp>

// const int Xe_ARC[] = {0x5600, 0x4f};
const std::vector<int> Xe_Iris_IDs = {0x4900, 0xa700};
const std::vector<int> UHD_IDs = {0x4600};

enum SYCL_HW_FAMILY {
SYCL_HW_FAMILY_UNKNOWN = -1,
SYCL_HW_FAMILY_INTEL_IGPU = 0
};

bool is_in_vector(std::vector<int> &vec, int item);

SYCL_HW_FAMILY get_device_family(sycl::device *device_ptr);

#endif // SYCL_HW_HPP

0 comments on commit 74e3185

Please sign in to comment.