From 2f768f43bd5dafc3d65e2a6bc5b673621e109065 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Fri, 31 Mar 2023 15:00:27 +0900 Subject: [PATCH] Add check for OpenCL kernel file --- src/blue_noise.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/blue_noise.cpp b/src/blue_noise.cpp index a57f322..95fca22 100644 --- a/src/blue_noise.cpp +++ b/src/blue_noise.cpp @@ -47,6 +47,10 @@ image::Bl dither::blue_noise(int width, int height, int threads, bool use_opencl { char buf[1024]; std::ifstream program_file("src/blue_noise.cl"); + if (!program_file.good()) { + std::cerr << "ERROR: Failed to read \"src/blue_noise.cl\" (not found?)\n"; + break; + } std::string program_string; while(program_file.good()) { program_file.read(buf, 1024);