Remove duplicated random_in_ranges function (#763)

This function is duplicated across clCopyImages files, so just keep one
definition in common file, and get rid of the duplicated ones.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
This commit is contained in:
Radek Szymanski
2020-05-06 13:09:48 +01:00
committed by GitHub
parent 8d28a5dc83
commit 77d755c8ee
6 changed files with 11 additions and 42 deletions

View File

@@ -158,3 +158,10 @@ int get_format_list(cl_context context, cl_mem_object_type imageType,
test_error(error, "Unable to get list of supported image formats");
return 0;
}
size_t random_in_ranges(size_t minimum, size_t rangeA, size_t rangeB, MTdata d)
{
if (rangeB < rangeA) rangeA = rangeB;
if (rangeA < minimum) return rangeA;
return (size_t)random_in_range((int)minimum, (int)rangeA - 1, d);
}