|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hiya.
I'm working on the POV-RAY source code, with the latest stable release, but I'm
having a few issues.
In normal.cpp I am getting a number of errors which don't seem to make any
sense. The errors are :
argument of type "TNORMAL *" is incompatible with parameter of type "TNORMAL *"
a value of type "BLEND_MAP *" cannot be used to initialize an entity of type
"BLEND_MAP *"
and a few others along the same lines.
To me this seems stupid saying that a type is not compatible with its own type,
so I'm a bit confused.
Any help?
Thanks
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 29/03/2011 16:25, Aidy nous fit lire :
> Hiya.
>
> I'm working on the POV-RAY source code, with the latest stable release, but I'm
> having a few issues.
>
> In normal.cpp I am getting a number of errors which don't seem to make any
> sense. The errors are :
>
> argument of type "TNORMAL *" is incompatible with parameter of type "TNORMAL *"
> a value of type "BLEND_MAP *" cannot be used to initialize an entity of type
> "BLEND_MAP *"
>
> and a few others along the same lines.
>
> To me this seems stupid saying that a type is not compatible with its own type,
> so I'm a bit confused.
>
> Any help?
Latest stable : 3.6.2 ?
What is your compiler ?
what are your flag ?
WHAT... is your favorite color ?
Oops, wrong movie.
Could you please provide the error lines' number ?
(or a copy-paste of the errors)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Version 3.6.2, yes.
Using Visual Studio 2010 so the compile that comes with that.
What do you mean by my flag??
The two errors I provided are repeated a few times just with different data
types. All of the errors however complain about a data type not being compatible
with its own kind.
A few of the lines with errors are :
noise = cuNoise (EPoint, (TPATTERN*)Tnormal);
BLEND_MAP *Map = Tnormal->Blend_Map;
cuPerturb_Normal(V2,Map->Blend_Map_Entries[i].Vals.Tnormal,EPoint, Inter);
There are others but the error messages are all much the same.
The method names are slightly different but this is due to the work that I am
doing. This code may be being interpreted by the NVCC compiler but I'm not sure.
I still don't understand why the error is occurring though.
Thanks
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 29/03/2011 16:25, Aidy nous fit lire :
> > Hiya.
> >
> > I'm working on the POV-RAY source code, with the latest stable release, but I'm
> > having a few issues.
> >
> > In normal.cpp I am getting a number of errors which don't seem to make any
> > sense. The errors are :
> >
> > argument of type "TNORMAL *" is incompatible with parameter of type "TNORMAL *"
> > a value of type "BLEND_MAP *" cannot be used to initialize an entity of type
> > "BLEND_MAP *"
> >
> > and a few others along the same lines.
> >
> > To me this seems stupid saying that a type is not compatible with its own type,
> > so I'm a bit confused.
> >
> > Any help?
>
> Latest stable : 3.6.2 ?
> What is your compiler ?
> what are your flag ?
> WHAT... is your favorite color ?
> Oops, wrong movie.
>
> Could you please provide the error lines' number ?
> (or a copy-paste of the errors)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 29/03/2011 18:06, Aidy nous fit lire :
> Version 3.6.2, yes.
> Using Visual Studio 2010 so the compile that comes with that.
> What do you mean by my flag??
The option of your compiler (project/setting/compiler/... that kind of
things)
>
> The two errors I provided are repeated a few times just with different data
> types.
What is the EXACT text of the errors, (or is it your version of it) ?
It's painful enough to try to understand an error message without adding
layer(s) of grease...
Please provide a FULL copy of the error message (not it's
interpretation) as well as at least the code of the calling function
(from start of function to at least the error line!)
Cristal ball currently broken, please help with accurate data.
> All of the errors however complain about a data type not being compatible
> with its own kind.
>
> A few of the lines with errors are :
>
> noise = cuNoise (EPoint, (TPATTERN*)Tnormal);
>
> BLEND_MAP *Map = Tnormal->Blend_Map;
>
> cuPerturb_Normal(V2,Map->Blend_Map_Entries[i].Vals.Tnormal,EPoint, Inter);
>
No such code as cuNoise & cuPerturb_Normal... Can you be playing odd
with some Const ?
>
> There are others but the error messages are all much the same.
> The method names are slightly different but this is due to the work that I am
> doing. This code may be being interpreted by the NVCC compiler but I'm not sure.
> I still don't understand why the error is occurring though.
>>
>> Could you please provide the error lines' number ?
>> (or a copy-paste of the errors)
>
>
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
That is the exact text of the error. I'm not at a stage of being able to compile
the code yet, it is simply giving me the errors as if they are syntax errors.
But the error messages I've given are the exact messages I am receiving. There
is no more information provided :(
The first error I'm coming across is in the method dents (cuDents for me) :
__device__ static void cuDents (VECTOR EPoint, TNORMAL *Tnormal, VECTOR normal)
{
DBL noise;
VECTOR stucco_turb;
noise = cuNoise (EPoint, (TPATTERN*)Tnormal); THIS LINE HAS THE ERROR
noise = noise * noise * noise * Tnormal->Amount;
/* Get normal displacement value. */
cuDNoise(stucco_turb, EPoint);
/* Displace "normal". */
cuVAddScaledEq(normal, noise, stucco_turb);
}
The next error appears in the function do_Average_Normals :
__device__ static void cuDo_Average_Normals (VECTOR EPoint,TNORMAL
*Tnormal,VECTOR normal, INTERSECTION *Inter)
{
int i;
BLEND_MAP *Map = Tnormal->Blend_Map; ERROR ON THIS LINE
SNGL Value;
SNGL Total = 0.0;
VECTOR V1,V2;
cuMake_Vector (V1, 0.0, 0.0, 0.0);
for (i = 0; i < Map->Number_Of_Entries; i++)
{
Value = Map->Blend_Map_Entries[i].value;
cuAssign_Vector(V2,normal);
cuPerturb_Normal(V2,Map->Blend_Map_Entries[i].Vals.Tnormal,EPoint, Inter);
ERROR ON THIS LINE ^ AS WELL
cuVAddScaledEq(V1,Value,V2);
Total += Value;
}
cuVInverseScale(normal,V1,Total);
}
The first error has just the ( of (TPATTERN *) highlighted in red as an error
and nothing else.
The second error has Tnormal highlighted as the error.
The third error has Map highlighted as the error
The three errors I receive above, in order, in full text are :
Error: Argument of type "TPATTERN * " is incompatible with parameter of type
"TPATTERN * "
TNORMAL *Tnormal
Error: A value of type "BLEND_MAP * " cannot be used to initialize an entity of
type "BLEND_MAP * "
and
BLEND_MAP *Map
Error: argument of type "TNORMAL * " is incompatible with parameter of type
"TNORMAL * "
Hope this is of more help
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 29/03/2011 18:06, Aidy nous fit lire :
> > Version 3.6.2, yes.
> > Using Visual Studio 2010 so the compile that comes with that.
> > What do you mean by my flag??
>
> The option of your compiler (project/setting/compiler/... that kind of
> things)
>
> >
> > The two errors I provided are repeated a few times just with different data
> > types.
>
> What is the EXACT text of the errors, (or is it your version of it) ?
> It's painful enough to try to understand an error message without adding
> layer(s) of grease...
>
> Please provide a FULL copy of the error message (not it's
> interpretation) as well as at least the code of the calling function
> (from start of function to at least the error line!)
>
> Cristal ball currently broken, please help with accurate data.
>
> > All of the errors however complain about a data type not being compatible
> > with its own kind.
> >
> > A few of the lines with errors are :
> >
> > noise = cuNoise (EPoint, (TPATTERN*)Tnormal);
> >
> > BLEND_MAP *Map = Tnormal->Blend_Map;
> >
> > cuPerturb_Normal(V2,Map->Blend_Map_Entries[i].Vals.Tnormal,EPoint, Inter);
> >
>
> No such code as cuNoise & cuPerturb_Normal... Can you be playing odd
> with some Const ?
>
>
> >
> > There are others but the error messages are all much the same.
> > The method names are slightly different but this is due to the work that I am
> > doing. This code may be being interpreted by the NVCC compiler but I'm not sure.
> > I still don't understand why the error is occurring though.
>
> >>
> >> Could you please provide the error lines' number ?
> >> (or a copy-paste of the errors)
> >
> >
> >
> >
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 29/03/2011 19:33, Aidy nous fit lire :
> That is the exact text of the error. I'm not at a stage of being able to compile
> the code yet, it is simply giving me the errors as if they are syntax errors.
> But the error messages I've given are the exact messages I am receiving. There
> is no more information provided :(
>
Oki... ;-)
Could it be that part of your rewrite (Do_Average_Normals --> cu...) is
incomplete and conflicting on TNORMAL ? (such as existing in more than
one form: the povray one and another one ?)
You should search for the definition (in your source tree) of BLEND_MAP,
TNORMAL & TPATTERN.
From the 3.6.1 unix code (your code might vary):
In source/frame.h, TNORMAL is a struct Tnormal_Struct
struct Tnormal_Struct
{
TPATTERN_FIELDS
SNGL Amount;
SNGL Delta; /* NK delta */
};
TPATTERN is a struct struct Pattern_Struct
struct Pattern_Struct
{
TPATTERN_FIELDS
};
TPATTERN_FIELDS is a collection of fields, happily mixing union & struct.
If no reordering occured (such as asking the compiler to compact the
structure... a nice option which is strongly discouraged with povray),
there should be no problem to cast a TNORMAL* into a TPATTERN*.
(as long as both are what we thing they are).
But error on Tnormal make me believe the type TNORMAL is not from
frame.h for your compilation.
A Windows C++ expert is probably needed.
Now, there is that __device__ keyword... inlining code might have issue
with structures & casting. You might want to rewrite the casted pointer
as a reference instead... I do not know if it would work.
> The first error I'm coming across is in the method dents (cuDents for me) :
>
> __device__ static void cuDents (VECTOR EPoint, TNORMAL *Tnormal, VECTOR normal)
> {
> DBL noise;
> VECTOR stucco_turb;
>
> noise = cuNoise (EPoint, (TPATTERN*)Tnormal); THIS LINE HAS THE ERROR
>
> noise = noise * noise * noise * Tnormal->Amount;
>
> /* Get normal displacement value. */
> cuDNoise(stucco_turb, EPoint);
>
> /* Displace "normal". */
> cuVAddScaledEq(normal, noise, stucco_turb);
> }
>
> The next error appears in the function do_Average_Normals :
>
> __device__ static void cuDo_Average_Normals (VECTOR EPoint,TNORMAL
> *Tnormal,VECTOR normal, INTERSECTION *Inter)
> {
> int i;
> BLEND_MAP *Map = Tnormal->Blend_Map; ERROR ON THIS LINE
> SNGL Value;
> SNGL Total = 0.0;
> VECTOR V1,V2;
>
> cuMake_Vector (V1, 0.0, 0.0, 0.0);
>
> for (i = 0; i < Map->Number_Of_Entries; i++)
> {
> Value = Map->Blend_Map_Entries[i].value;
>
> cuAssign_Vector(V2,normal);
>
> cuPerturb_Normal(V2,Map->Blend_Map_Entries[i].Vals.Tnormal,EPoint, Inter);
> ERROR ON THIS LINE ^ AS WELL
>
> cuVAddScaledEq(V1,Value,V2);
>
> Total += Value;
> }
>
> cuVInverseScale(normal,V1,Total);
> }
>
> The first error has just the ( of (TPATTERN *) highlighted in red as an error
> and nothing else.
>
> The second error has Tnormal highlighted as the error.
>
> The third error has Map highlighted as the error
>
>
>
> The three errors I receive above, in order, in full text are :
>
> Error: Argument of type "TPATTERN * " is incompatible with parameter of type
> "TPATTERN * "
>
> TNORMAL *Tnormal
> Error: A value of type "BLEND_MAP * " cannot be used to initialize an entity of
> type "BLEND_MAP * "
>
> and
>
> BLEND_MAP *Map
> Error: argument of type "TNORMAL * " is incompatible with parameter of type
> "TNORMAL * "
>
>
> Hope this is of more help
>
>
> Le_Forgeron <jgr### [at] freefr> wrote:
>> Le 29/03/2011 18:06, Aidy nous fit lire :
>>> Version 3.6.2, yes.
>>> Using Visual Studio 2010 so the compile that comes with that.
>>> What do you mean by my flag??
>>
>> The option of your compiler (project/setting/compiler/... that kind of
>> things)
>>
>>>
>>> The two errors I provided are repeated a few times just with different data
>>> types.
>>
>> What is the EXACT text of the errors, (or is it your version of it) ?
>> It's painful enough to try to understand an error message without adding
>> layer(s) of grease...
>>
>> Please provide a FULL copy of the error message (not it's
>> interpretation) as well as at least the code of the calling function
>> (from start of function to at least the error line!)
>>
>> Cristal ball currently broken, please help with accurate data.
>>
>>> All of the errors however complain about a data type not being compatible
>>> with its own kind.
>>>
>>> A few of the lines with errors are :
>>>
>>> noise = cuNoise (EPoint, (TPATTERN*)Tnormal);
>>>
>>> BLEND_MAP *Map = Tnormal->Blend_Map;
>>>
>>> cuPerturb_Normal(V2,Map->Blend_Map_Entries[i].Vals.Tnormal,EPoint, Inter);
>>>
>>
>> No such code as cuNoise & cuPerturb_Normal... Can you be playing odd
>> with some Const ?
>>
>>
>>>
>>> There are others but the error messages are all much the same.
>>> The method names are slightly different but this is due to the work that I am
>>> doing. This code may be being interpreted by the NVCC compiler but I'm not sure.
>>> I still don't understand why the error is occurring though.
>>
>>>>
>>>> Could you please provide the error lines' number ?
>>>> (or a copy-paste of the errors)
>>>
>>>
>>>
>>>
>
>
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
OK I've fiddled around with it a bit, and the first error on (TPATTERN *)Tnormal
doesn't appear to be an error to do with the casting. That seems to be working
fine (I created a new TPATTERN * variable and assigned it to the cast Tnormal
without error) however it errors when using that in the method call to cuNoise.
My declaration of cuNoise is :
__device__ INLINE_NOISE DBL cuNoise (VECTOR EPoint,TPATTERN *TPat)
and is inside the texture file, as it was before (i've moved a lot of things
around but all methods are still in the same relative places. e.g methods
originally in texture are now in cuTexture.)
The cuNoise definition clearly requires a TPATTERN pointer, yet I still get the
error? I am including the cuTexture header file where the prototype of the
cuNoise method exists. Everything SEEMS correct, and short of the naming of
methods, it is identical to the original code to the best of my knowledge :(
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 29/03/2011 19:33, Aidy nous fit lire :
> > That is the exact text of the error. I'm not at a stage of being able to compile
> > the code yet, it is simply giving me the errors as if they are syntax errors.
> > But the error messages I've given are the exact messages I am receiving. There
> > is no more information provided :(
> >
>
> Oki... ;-)
>
> Could it be that part of your rewrite (Do_Average_Normals --> cu...) is
> incomplete and conflicting on TNORMAL ? (such as existing in more than
> one form: the povray one and another one ?)
>
> You should search for the definition (in your source tree) of BLEND_MAP,
> TNORMAL & TPATTERN.
>
> From the 3.6.1 unix code (your code might vary):
>
> In source/frame.h, TNORMAL is a struct Tnormal_Struct
> struct Tnormal_Struct
> {
> TPATTERN_FIELDS
> SNGL Amount;
> SNGL Delta; /* NK delta */
> };
>
> TPATTERN is a struct struct Pattern_Struct
> struct Pattern_Struct
> {
> TPATTERN_FIELDS
> };
>
> TPATTERN_FIELDS is a collection of fields, happily mixing union & struct.
>
> If no reordering occured (such as asking the compiler to compact the
> structure... a nice option which is strongly discouraged with povray),
> there should be no problem to cast a TNORMAL* into a TPATTERN*.
> (as long as both are what we thing they are).
>
> But error on Tnormal make me believe the type TNORMAL is not from
> frame.h for your compilation.
>
> A Windows C++ expert is probably needed.
>
> Now, there is that __device__ keyword... inlining code might have issue
> with structures & casting. You might want to rewrite the casted pointer
> as a reference instead... I do not know if it would work.
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 29.03.11 21:01, Aidy wrote:
> OK I've fiddled around with it a bit, and the first error on (TPATTERN *)Tnormal
> doesn't appear to be an error to do with the casting. That seems to be working
> fine (I created a new TPATTERN * variable and assigned it to the cast Tnormal
> without error) however it errors when using that in the method call to cuNoise.
>
> My declaration of cuNoise is :
>
> __device__ INLINE_NOISE DBL cuNoise (VECTOR EPoint,TPATTERN *TPat)
>
> and is inside the texture file, as it was before (i've moved a lot of things
> around but all methods are still in the same relative places. e.g methods
> originally in texture are now in cuTexture.)
>
> The cuNoise definition clearly requires a TPATTERN pointer, yet I still get the
> error? I am including the cuTexture header file where the prototype of the
> cuNoise method exists. Everything SEEMS correct, and short of the naming of
> methods, it is identical to the original code to the best of my knowledge :(
Well, the question to ask is simple: Why are you renaming all functions in
POV-Ray? And the immediate conclusion is to ask: Did the code work *before*
you changed it?
Thorsten
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 29/03/2011 21:01, Aidy nous fit lire :
> OK I've fiddled around with it a bit, and the first error on (TPATTERN *)Tnormal
> doesn't appear to be an error to do with the casting. That seems to be working
> fine (I created a new TPATTERN * variable and assigned it to the cast Tnormal
> without error) however it errors when using that in the method call to cuNoise.
>
> My declaration of cuNoise is :
>
> __device__ INLINE_NOISE DBL cuNoise (VECTOR EPoint,TPATTERN *TPat)
>
> and is inside the texture file, as it was before (i've moved a lot of things
> around but all methods are still in the same relative places. e.g methods
> originally in texture are now in cuTexture.)
>
> The cuNoise definition clearly requires a TPATTERN pointer, yet I still get the
> error? I am including the cuTexture header file where the prototype of the
> cuNoise method exists. Everything SEEMS correct, and short of the naming of
> methods, it is identical to the original code to the best of my knowledge :(
>
>> Now, there is that __device__ keyword... inlining code might have issue
>> with structures & casting. You might want to rewrite the casted pointer
>> as a reference instead... I do not know if it would work.
>>
>
>
Please, read.
__device__ is going to inline the function (or I'm just getting it
wrong, which is 90% likely).
That means that you cannot give a pointer and hope you can access it's
structure. You need to pass the structure itself.
(and if you are trying what I believe, it cannot work without passing
the content of the structure... which is gonna be a problem because
there is not enough registers for all the fields)
Google clue: __device__
> http://code.google.com/p/stanford-cs193g-sp2010/wiki/TutorialDeviceFunctions
http://forums.nvidia.com/index.php?showtopic=83335
Cuda...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Please, read.
> __device__ is going to inline the function (or I'm just getting it
> wrong, which is 90% likely).
Sorry I missed that bit. You're right, I've just looking through the nVidia
documentation, and the link you sent me and it will inline it.
If it inlines it then, can I pass the structure itself and NOT have it create a
copy within the function itself?? It shouldn't increase the overhead at all
should it??
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|