From a7c5e97a123789cd894f2264a696ab23646212c2 Mon Sep 17 00:00:00 2001 From: ExceptionallyGreat <33473980+ExceptionallyGreat@users.noreply.github.com> Date: Tue, 21 Nov 2017 12:06:20 -0800 Subject: [PATCH] Update gpu.cpp Fix for AMD GPU detection on MacOS X On MacOS X the platform is reported as Apple, and the vendor is reported as AMD. --- xmrstak/backend/amd/amd_gpu/gpu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xmrstak/backend/amd/amd_gpu/gpu.cpp b/xmrstak/backend/amd/amd_gpu/gpu.cpp index 15b8457..879a2e4 100644 --- a/xmrstak/backend/amd/amd_gpu/gpu.cpp +++ b/xmrstak/backend/amd/amd_gpu/gpu.cpp @@ -476,7 +476,7 @@ std::vector<GpuContext> getAMDDevices(int index) if(clStatus == CL_SUCCESS) { std::string devVendor(devVendorVec.data()); - if( devVendor.find("Advanced Micro Devices") != std::string::npos) + if( devVendor.find("Advanced Micro Devices") != std::string::npos || devVendor.find("AMD") != std::string::npos) { GpuContext ctx; ctx.deviceIdx = k; @@ -541,7 +541,7 @@ int getAMDPlatformIdx() clGetPlatformInfo(platforms[i], CL_PLATFORM_VENDOR, infoSize, platformNameVec.data(), NULL); std::string platformName(platformNameVec.data()); - if( platformName.find("Advanced Micro Devices") != std::string::npos) + if( platformName.find("Advanced Micro Devices") != std::string::npos || platformName.find("Apple") != std::string::npos) { platformIndex = i; printer::inst()->print_msg(L0,"Found AMD platform index id = %i, name = %s",i , platformName.c_str()); -- GitLab