<br><br><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
balay@bb30:~/ex>cat <a href="http://ex1.cu" target="_blank">ex1.cu</a><br>
#include "petsc.h"<br>
#undef VecType<br>
<br>
#include<iostream><br>
#include <cusp/krylov/cg.h><br>
<br>
int main(int argc,char **argv)<br>
{<br>
PetscErrorCode ierr;<br>
ierr = PetscInitialize(&argc,&argv,(char *)0,(char*)0);CHKERRQ(ierr);<br>
<div class="im"> std::cout<<"Hello World!"<<std::endl;<br>
</div> ierr = PetscFinalize();<br>
return 0;<br>
}<br>
<br></blockquote><div> </div><div>That almost works except that petsc.h doesn't include all definitions/declarations. I have a function which cannot be compiled by just adding petsc.h with errors like:<br>error: identifier "CUSPARRAY" is undefined<br>
error: identifier "Mat_SeqAIJ" is undefined<br>error: identifier "Mat_SeqAIJCUSP" is undefined<br>ect. <br>But it can be compiled if I add the following in addition to petsc.h<br><br>PETSC_CUDA_EXTERN_C_BEGIN<br>
#include "../src/mat/impls/aij/seq/aij.h" /*I "petscmat.h" I*/<br>#include "petscbt.h"<br>#include "../src/vec/vec/impls/dvecimpl.h"<br>#include "private/vecimpl.h"<br>
PETSC_CUDA_EXTERN_C_END<br>#undef VecType<br>#include "../src/mat/impls/aij/seq/seqcusp/cuspmatimpl.h"<br><br>What's the minimal set of headers I can add to petsc.h such that I can call alll petsc functions and use all petsc type?<br>
Thanks.<br><br><br>Shiyuan <br><br><br><br><br><br><br><br> </div><br></div><br>