Skip to content

Can't build mpark::visit under cuda compiler #63

@ryderblue

Description

@ryderblue

I'm trying to build code using mpark::visit, which compiles fine under gcc/clang, but fails to compile with CUDA compiler:

visit-test.cpp(11): error: no instance of function template "mpark::visit" matches the argument list
            argument types are: (Visit, mpark::variant<int>)

I installed CUDA compiler on Ubuntu 18.04:

$ sudo apt-get install nvidia-cuda-toolkit
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85

Simple example:

#include <mpark/variant.hpp>

struct Visit {
  std::string operator()(int i) const {
    return "int";
  }
};

void test() {
  mpark::variant<int> i(1);
  mpark::visit(Visit{}, i);
}

Here's the gist with makefile:
https://git.zooxlabs.com/gist/rrishel/cbfb122a65cdb629f89233e1fa2bc96c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions