Cycles: Report device maximum allocation and detected global size

This commit is contained in:
Sergey Sharybin 2017-02-20 13:02:11 +01:00 committed by Mai Lavelle
parent 365a4239c5
commit a87766416f
3 changed files with 16 additions and 0 deletions

View File

@ -302,9 +302,13 @@ public:
{
size_t max_buffer_size;
clGetDeviceInfo(device->cdDevice, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(size_t), &max_buffer_size, NULL);
VLOG(1) << "Maximum device allocation side: "
<< string_human_readable_number(max_buffer_size) << " bytes. ("
<< string_human_readable_size(max_buffer_size) << ").";
size_t num_elements = max_elements_for_max_buffer_size(max_buffer_size / 2, task->passes_size);
int2 global_size = make_int2(round_down((int)sqrt(num_elements), 64), (int)sqrt(num_elements));
VLOG(1) << "Global size: " << global_size << ".";
return global_size;
}
};

View File

@ -68,6 +68,15 @@ void util_logging_verbosity_set(int verbosity)
#endif
}
std::ostream& operator <<(std::ostream &os,
const int2 &value)
{
os << "(" << value.x
<< ", " << value.y
<< ")";
return os;
}
std::ostream& operator <<(std::ostream &os,
const float3 &value)
{

View File

@ -45,12 +45,15 @@ public:
#define VLOG_ONCE(level, flag) if(!flag) flag = true, VLOG(level)
struct int2;
struct float3;
void util_logging_init(const char *argv0);
void util_logging_start(void);
void util_logging_verbosity_set(int verbosity);
std::ostream& operator <<(std::ostream &os,
const int2 &value);
std::ostream& operator <<(std::ostream &os,
const float3 &value);