It may not be pthreads, but a CUDA error.  Here is the console output:
C:\DATA\Developer\DeepLearning\pytorch\exampleTorchApp\build>cmake -D CMAKE_PREFIX_PATH=c:\DATA\Developer\DeepLearning\pytorch\libtorch_win\libtorch -G “Visual Studio 15 2017 Win64”  …
– Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134.
– The C compiler identification is MSVC 19.16.27026.1
– The CXX compiler identification is MSVC 19.16.27026.1
– Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
– Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
– Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Looking for pthread.h
– Looking for pthread.h - not found
– Found Threads: TRUE
– Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0 (found suitable version “9.0”, minimum required is “7.0”)
– Caffe2: CUDA detected: 9.0
– Caffe2: CUDA nvcc is: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/bin/nvcc.exe
– Caffe2: CUDA toolkit directory: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0
– Caffe2: Header version is: 9.0
– Found CUDNN: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/include
– Found cuDNN: v7.4.1  (include: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/include, library: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/lib/x64/cudnn.lib)
– Autodetected CUDA architecture(s): 6.1
– Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
CMake Error at C:/DATA/Developer/DeepLearning/pytorch/libtorch_win/libtorch/share/cmake/Caffe2/public/cuda.cmake:368 (message):
**  Unknown cmake build type:**
Call Stack (most recent call first):
C:/DATA/Developer/DeepLearning/pytorch/libtorch_win/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:88 (include)
C:/DATA/Developer/DeepLearning/pytorch/libtorch_win/libtorch/share/cmake/Torch/TorchConfig.cmake:39 (find_package)
CMakeLists.txt:4 (find_package)
– Configuring incomplete, errors occurred!
See also “C:/DATA/Developer/DeepLearning/pytorch/exampleTorchApp/build/CMakeFiles/CMakeOutput.log”.
See also “C:/DATA/Developer/DeepLearning/pytorch/exampleTorchApp/build/CMakeFiles/CMakeError.log”.
C:\DATA\Developer\DeepLearning\pytorch\exampleTorchApp\build>