0

I am new to learn about renderscript. I am writing a small sample, and I found that when I write a try block in root, the compiler gives me a syntax error tip.So I want to know wheather render script could support exception in root functions.

I know the renderscript is based on C99, so maybe it can not support this, am I right?

gongweixue
  • 155
  • 2
  • 11

1 Answers1

1

Exceptions are a C++ feature, and are not available in C99. They are thus not available in RenderScript, since we are C99-based.

Stephen Hines
  • 2,612
  • 1
  • 13
  • 12
  • All right. As I know, some parallel architectures like OpenCL doesn't support "exception". Dose it mean that catching exceptions is not the responsibility of kernel, it should not be processed in root functions? – gongweixue Oct 18 '13 at 08:08
  • There are no "exceptions" in C. If you dereference a NULL pointer or access invalid memory, you will get a segmentation fault (SIGSEGV). If you do related bad things, it will trigger the normal C behaviors (SIGBUS, etc.). Why do you think that a kernel would trigger or catch an "exception"? Exceptions could occur in the Java portion of the code, which the kernel would not be invoking, so there is nothing else to check. – Stephen Hines Oct 18 '13 at 08:51