qcor icon indicating copy to clipboard operation
qcor copied to clipboard

asserts in quantum kernels

Open amccaskey opened this issue 4 years ago • 0 comments

__qpu__ void hwe(qreg q, std::vector<double> x, const int layers, 
                    std::vector<std::pair<int,int>> cnot_coupling) {
    assert(x.size() == layers*q.size()*5);
... 
}

we should try to support asserts like the above in quantum kernels. right now this is a compile error

<built-in>:21:154: error: use of undeclared identifier 'extension__'
( static_cast < bool > ( x . size ( ) == layers * q . size ( ) * 5 ) ? void ( 0 ) : assert_fail ( "x.size() == layers*q.size()*5" , "hwe_test.cpp" , 3 , extension__ PRETTY_FUNCTION__ ) ) ; 

amccaskey avatar Nov 03 '20 15:11 amccaskey