__declspec support for function declarations.
safe: indicates that the function can safely be called with an "all off" execution mask. costN: (N an integer) overrides the cost estimate for the function with the given value.
This commit is contained in:
29
expr.cpp
29
expr.cpp
@@ -3518,18 +3518,23 @@ int
|
||||
FunctionCallExpr::EstimateCost() const {
|
||||
if (isLaunch)
|
||||
return COST_TASK_LAUNCH;
|
||||
else if (dynamic_cast<FunctionSymbolExpr *>(func) == NULL) {
|
||||
// it's going through a function pointer
|
||||
const Type *fpType = func->GetType();
|
||||
if (fpType != NULL) {
|
||||
Assert(dynamic_cast<const PointerType *>(fpType) != NULL);
|
||||
if (fpType->IsUniformType())
|
||||
return COST_FUNPTR_UNIFORM;
|
||||
else
|
||||
return COST_FUNPTR_VARYING;
|
||||
}
|
||||
}
|
||||
return COST_FUNCALL;
|
||||
|
||||
const Type *type = func->GetType();
|
||||
if (type == NULL)
|
||||
return 0;
|
||||
|
||||
const PointerType *pt = dynamic_cast<const PointerType *>(type);
|
||||
if (pt != NULL)
|
||||
type = type->GetBaseType();
|
||||
const FunctionType *ftype = dynamic_cast<const FunctionType *>(type);
|
||||
|
||||
if (ftype->costOverride > -1)
|
||||
return ftype->costOverride;
|
||||
|
||||
if (pt != NULL)
|
||||
return pt->IsUniformType() ? COST_FUNPTR_UNIFORM : COST_FUNPTR_VARYING;
|
||||
else
|
||||
return COST_FUNCALL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user