Skip to content

Commit 827e8eb

Browse files
committed
Add proper error message when buffer size exceeds device's limit
1 parent 5ead797 commit 827e8eb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

NNEDI3CL/NNEDI3CL.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ void VS_CC nnedi3clCreate(const VSMap *in, VSMap *out, void *userData, VSCore *c
566566
delete[] weights0;
567567
delete[] weights1;
568568

569+
if (dims1 * 2 > d->gpu.get_info<size_t>(CL_DEVICE_IMAGE_MAX_BUFFER_SIZE))
570+
throw std::string{ "the device's 1D Image Max Buffer Size is too small. Reduce nsize/nns...or buy a new graphics card" };
571+
569572
if (!!vsapi->propGetInt(in, "info", 0, &err)) {
570573
std::string text{ "=== Device Info ===\n" };
571574
text += "Name: " + d->gpu.get_info<CL_DEVICE_NAME>() + "\n";

0 commit comments

Comments
 (0)