C++: added access to CL's platform id via driver::Platform
This commit is contained in:
@@ -26,6 +26,7 @@ public:
|
||||
std::string name() const;
|
||||
std::string version() const;
|
||||
void devices(std::vector<Device> &) const;
|
||||
cl_platform_id cl_id() const;
|
||||
private:
|
||||
backend_type backend_;
|
||||
cl_platform_id cl_platform_;
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
|
||||
#include "isaac/driver/device.h"
|
||||
#include "helpers/ocl/infos.hpp"
|
||||
@@ -60,12 +62,27 @@ Device::Vendor Device::vendor() const
|
||||
return Vendor::UNKNOWN;
|
||||
}
|
||||
|
||||
|
||||
Device::Architecture Device::architecture() const
|
||||
{
|
||||
switch(vendor())
|
||||
{
|
||||
case Vendor::INTEL:
|
||||
{
|
||||
// int64_t product;
|
||||
|
||||
// char* id = (char*)(platform().cl_id());
|
||||
// for(unsigned int aa = 0 ; aa < 128 ; ++aa)
|
||||
// {
|
||||
// std::uintptr_t ptrid = (std::uintptr_t)id;
|
||||
// if(aa && ptrid % aa)
|
||||
// ptrid += aa - ptrid % aa;
|
||||
// id = (char*)(ptrid);
|
||||
|
||||
// std::memcpy(&product, id, sizeof(product));
|
||||
// std::cout << product << std::endl;
|
||||
|
||||
// }
|
||||
return Architecture::BROADWELL;
|
||||
}
|
||||
default:
|
||||
|
@@ -47,6 +47,11 @@ std::string Platform::name() const
|
||||
}
|
||||
}
|
||||
|
||||
cl_platform_id Platform::cl_id() const
|
||||
{
|
||||
return cl_platform_;
|
||||
}
|
||||
|
||||
void Platform::devices(std::vector<Device> & devices) const
|
||||
{
|
||||
switch(backend_)
|
||||
|
@@ -460,23 +460,23 @@ gemm_parameters::gemm_parameters(unsigned int simd_width
|
||||
stream << "}" << std::endl;
|
||||
|
||||
|
||||
// if(A_trans_=='N' || B_trans_=='T')
|
||||
// stream << "int Ky = K - idT.y;" << std::endl;
|
||||
// if(A_trans_=='T' || B_trans_=='N')
|
||||
// stream << "int Kx = K - idT.x;" << std::endl;
|
||||
if(A_trans_=='N' || B_trans_=='T')
|
||||
stream << "int Ky = K - idT.y;" << std::endl;
|
||||
if(A_trans_=='T' || B_trans_=='N')
|
||||
stream << "int Kx = K - idT.x;" << std::endl;
|
||||
|
||||
// if(A_trans_=='N' || B_trans_=='T')
|
||||
// for(unsigned int k = 0; k < p_.kL; k += p_.local_fetch_1)
|
||||
// stream << "int condy" << k << " = " << k << " < Ky;" << std::endl;
|
||||
if(A_trans_=='N' || B_trans_=='T')
|
||||
for(unsigned int k = 0; k < p_.kL; k += p_.local_fetch_1)
|
||||
stream << "int condy" << k << " = " << k << " < Ky;" << std::endl;
|
||||
|
||||
// if(A_trans_=='T' || B_trans_=='N')
|
||||
// {
|
||||
// for(unsigned int k = 0 ; k < p_.kL ; k += p_.local_fetch_0*p_.simd_width)
|
||||
// for(unsigned int s = 0 ; s < p_.simd_width ; ++s)
|
||||
// stream << "int condx" << k + s << " = " << k + s << " < Kx;" << std::endl;
|
||||
// }
|
||||
if(A_trans_=='T' || B_trans_=='N')
|
||||
{
|
||||
for(unsigned int k = 0 ; k < p_.kL ; k += p_.local_fetch_0*p_.simd_width)
|
||||
for(unsigned int s = 0 ; s < p_.simd_width ; ++s)
|
||||
stream << "int condx" << k + s << " = " << k + s << " < Kx;" << std::endl;
|
||||
}
|
||||
|
||||
// fetch_to_lds(true);
|
||||
fetch_to_lds(true);
|
||||
|
||||
stream << "//Write back C" << std::endl;
|
||||
stream << "M += ids.x;" << std::endl;
|
||||
|
Reference in New Issue
Block a user