This won't add build rule for `matrix_operations.cu` file. `ocv_create_module` compiles CUDA files only for .cu files from module folder. This can be fixed by adding explicit compilation command:

    if(HAVE_CUDA AND NOT ENABLE_DYNAMIC_CUDA)
      file(GLOB lib_cuda           "../dynamicuda/src/cuda/*.cu*")
      ocv_include_directories(${CUDA_INCLUDE_DIRS})
      ocv_cuda_compile(cuda_objs ${lib_cuda})
    endif()
    ...
    else()
      ocv_glob_module_sources(SOURCES "${opencv_core_BINARY_DIR}/version_string.inc" ${lib_cuda} ${cuda_objs}
                              HEADERS ${lib_cuda_hdrs} ${lib_cuda_hdrs_detail})
    endif()