forked from ggerganov/llama.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |