mirror of
https://github.com/matrix-construct/construct
synced 2024-06-02 18:18:56 +02:00
ircd:🆑 Split platform info banner out of main init.
This commit is contained in:
parent
c05e5e09de
commit
a04cc3c290
|
@ -41,6 +41,9 @@ namespace ircd::cl
|
|||
void log_dev_info(const uint platform_id);
|
||||
void log_dev_info();
|
||||
|
||||
void log_platform_info(const uint platform_id);
|
||||
void log_platform_info();
|
||||
|
||||
void flush();
|
||||
void sync();
|
||||
}
|
||||
|
|
40
ircd/cl.cc
40
ircd/cl.cc
|
@ -229,19 +229,8 @@ ircd::cl::init::init()
|
|||
// Get the platforms.
|
||||
call(clGetPlatformIDs, PLATFORM_MAX, platform, &platforms);
|
||||
|
||||
char buf[4][128];
|
||||
for(size_t i(0); i < platforms; ++i)
|
||||
log::logf
|
||||
{
|
||||
log, log::level::DEBUG,
|
||||
"OpenCL [%u][*] %-3d :%s :%s :%s :%s",
|
||||
i,
|
||||
CL_TARGET_OPENCL_VERSION,
|
||||
info(clGetPlatformInfo, platform[i], CL_PLATFORM_VERSION, buf[0]),
|
||||
info(clGetPlatformInfo, platform[i], CL_PLATFORM_VENDOR, buf[1]),
|
||||
info(clGetPlatformInfo, platform[i], CL_PLATFORM_NAME, buf[2]),
|
||||
info(clGetPlatformInfo, platform[i], CL_PLATFORM_EXTENSIONS, buf[3]),
|
||||
};
|
||||
// Report the platforms.
|
||||
log_platform_info();
|
||||
|
||||
size_t devices_total(0);
|
||||
for(size_t i(0); i < platforms; ++i)
|
||||
|
@ -338,6 +327,31 @@ noexcept
|
|||
dlclose(linkage);
|
||||
}
|
||||
|
||||
void
|
||||
ircd::cl::log_platform_info()
|
||||
{
|
||||
for(size_t i(0); i < platforms; ++i)
|
||||
log_platform_info(i);
|
||||
}
|
||||
|
||||
void
|
||||
ircd::cl::log_platform_info(const uint i)
|
||||
{
|
||||
char buf[3][64];
|
||||
char extbuf[320];
|
||||
log::logf
|
||||
{
|
||||
log, log::level::DEBUG,
|
||||
"OpenCL [%u][*] %-3d :%s :%s :%s :%s",
|
||||
i,
|
||||
CL_TARGET_OPENCL_VERSION,
|
||||
info(clGetPlatformInfo, platform[i], CL_PLATFORM_VERSION, buf[0]),
|
||||
info(clGetPlatformInfo, platform[i], CL_PLATFORM_VENDOR, buf[1]),
|
||||
info(clGetPlatformInfo, platform[i], CL_PLATFORM_NAME, buf[2]),
|
||||
info(clGetPlatformInfo, platform[i], CL_PLATFORM_EXTENSIONS, extbuf),
|
||||
};
|
||||
}
|
||||
|
||||
void
|
||||
ircd::cl::log_dev_info()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue