From b17fcc310fe7a93eb37fb08ac17c94676aa00a4b Mon Sep 17 00:00:00 2001 From: DepthDeluxe Date: Mon, 11 Apr 2016 22:39:57 -0400 Subject: [PATCH] cleaner l2 --- openbr/plugins/cuda/cudal2.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openbr/plugins/cuda/cudal2.cpp b/openbr/plugins/cuda/cudal2.cpp index f06ee9a..982a0a5 100644 --- a/openbr/plugins/cuda/cudal2.cpp +++ b/openbr/plugins/cuda/cudal2.cpp @@ -42,8 +42,16 @@ class CUDAL2Distance : public UntrainableDistance float* cudaAPtr = (float*)srcDataPtr[0]; int rows = *((int*)srcDataPtr[1]); int cols = *((int*)srcDataPtr[2]); + int srcType = *((int*)srcDataPtr[3]); - float* cudaBPtr = (float*)b.ptr()[0]; + void* const* dstDataPtr = b.ptr(); + float* cudaBPtr = (float*)dstDataPtr[0]; + int dstType = *((int*)dstDataPtr[3]); + + if (srcType != dstType) { + cout << "ERR: Type mismatch" << endl; + throw 0; + } float out; cuda::L2::wrapper(cudaAPtr, cudaBPtr, rows*cols, &out); -- libgit2 0.21.4