From ecc1f43d9f25dae521479681ad415fe160de2bf8 Mon Sep 17 00:00:00 2001 From: Stephane Rigaud Date: Mon, 28 Nov 2022 14:40:12 +0100 Subject: [PATCH] ADD: error message if file is not found --- clic/src/tier1/cleCustomKernel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clic/src/tier1/cleCustomKernel.cpp b/clic/src/tier1/cleCustomKernel.cpp index b1a63b2b8..e5afb116e 100644 --- a/clic/src/tier1/cleCustomKernel.cpp +++ b/clic/src/tier1/cleCustomKernel.cpp @@ -13,7 +13,11 @@ CustomKernel::CustomKernel(const ProcessorPointer & device, : Operation(device, nb_parameters) { std::ifstream ifs(filename); - std::string ocl_source((std::istreambuf_iterator(ifs)), (std::istreambuf_iterator())); + if (ifs.fail()) + { + std::cout << "Error in loading custom kernel, could not find file " << filename << std::endl; + } + std::string ocl_source((std::istreambuf_iterator(ifs)), (std::istreambuf_iterator())); this->SetSource(name, ocl_source); }