1

I'm using the QPU library created by mn416 on GitHub (https://github.com/mn416/QPULib) to run a sample code on Raspberry Pi 3B

I need to display the number of QPUs utilised by the GCD algorithm. I'm getting an error which seems to say that I'm performing an illegal type cast.

This is the functon for GCD:

void gcd(Ptr<Int> p, Ptr<Int> q, Ptr<Int> r)
{ 
  int nqpu=numQPUs();
  cout<<"number of QPUS="<<nqpu<<endl; // this line causes the error
  Int a = *p;
  Int b = *q;
  While (any(a != b))
    Where (a > b)
      a = a-b;
    End
    Where (a < b)
      b = b-a;
    End
  End
  *r = a;
}

I've tried to find out the author of this repository but I haven't been successful. If anyone could point me in the right direction, I wiuld highly appreciate it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.