367 Commits

Author SHA1 Message Date
Miao Wang
f94e77da7e [RenderScript] Fix potential leak in RS JNI
Bug: 27145639
Change-Id: I80cf2971d803a3366a63caa3612a503a88639040
(cherry picked from commit a4ad5f840173ecbfb679153a4f9460d2b06538e7)
2016-02-17 11:01:51 -08:00
Stephen Hines
0ff759ccae Merge "Remove the CREATE_FLAG_OPT_LEVEL_0 from the Java API." am: 49aee686d8
am: c033f493f2

* commit 'c033f493f23574dc69bf8ecd0f04af8910b4a47e':
  Remove the CREATE_FLAG_OPT_LEVEL_0 from the Java API.
2016-01-30 17:57:30 +00:00
Stephen Hines
49aee686d8 Merge "Remove the CREATE_FLAG_OPT_LEVEL_0 from the Java API." 2016-01-30 17:44:52 +00:00
Miao Wang
c29bcd0dcd [RenderScript] Unhide new Allocation APIs
Bug: 23535524

  - ByteBuffer getByteBuffer()
  - long getStride()
  - Allocation[] createAllocations(rs, type, usage, num)
  - long getTimeStamp()

Change-Id: I0cad88c81f9f48c7aca59af159c49f506b234aee
2016-01-27 14:42:03 -08:00
Miao Wang
a1c7bc7550 Merge "[RenderScript] Implement APIs for better multi-frame process support." am: 6ebdbfa549
am: d90b4a3266

* commit 'd90b4a3266ab2af3cbc6f131a0ed320f7a795a09':
  [RenderScript] Implement APIs for better multi-frame process support.
2016-01-27 22:02:17 +00:00
Miao Wang
8c1509249c [RenderScript] Implement APIs for better multi-frame process support.
Bug: 23535524

 Two APIs added for multiframe processing:
 - createAllocations(...): To create an array of Allocations sharing the
   same Type and Usage. For USAGE_IO_INPUT Allocations, they also share
   the same BufferQueue.
 - getTimeStamp(): API to retrieve the time stamp associated with the
   most recent buffer.

Change-Id: I6b7b35d7dca5e87ee2f3db2ee17cb9cf824bcfe1
2016-01-26 14:40:44 -08:00
Miao Wang
a11c28589e Merge "[RenderScript] Add API to map Allocation mallocptr to Java ByteBuffer" am: ed50f333fb
am: 5f210ae042

* commit '5f210ae04239f4a374763ea9ffe7176f5455017a':
  [RenderScript] Add API to map Allocation mallocptr to Java ByteBuffer
2016-01-26 01:27:30 +00:00
Miao Wang
ed50f333fb Merge "[RenderScript] Add API to map Allocation mallocptr to Java ByteBuffer" 2016-01-26 01:11:41 +00:00
Miao Wang
0facf021ea [RenderScript] Add API to map Allocation mallocptr to Java ByteBuffer
Bug: 25926361
Bug: 23535524

  - Construct the ByteBuffer using the AllocationGetPointer.
  - Add an API to query the stride of the allocation.
  - Both ByteBuffer and Stride will be cached for normal Allocations.
    if using USAGE_IO, since after each ioReceive, the mallocPtr will
    change, getByteBuffer will always create a new one using the most
    up-to-date mallocPtr.

Change-Id: I5e84b6690e83bb062c383043275524d0e51e46eb
2016-01-25 16:12:37 -08:00
David Gross
ba038689b1 Unhide Script::reduce() interface for general reduction.
Bug: 23535724

Change-Id: I7a43622954de9f4168f7e4376f39d6ec54191c03
2016-01-25 12:17:29 -08:00
David Gross
26ef7a739b Add general reduction plumbing starting with Java Script::reduce().
Requires coordinated change in frameworks/rs.

Bug: 23535724
Change-Id: I2fee6750cf542948d8fa87a98441002c4d84f36e
2016-01-15 12:20:08 -08:00
Yang Ni
263cc90345 Various fixes in setting globals in a script group
Bug: 25602504

1) Passing floating point values into a script group was broken,
since they were casted to long values. Fixed that in the frameworks
implementation by taking the raw bits instead.

2) Passing 64-bit values into a script group was broken on 32-bit
platforms, since they were casted to pointer-sized integers
(uintptr_t) in the JNI code. Fixed that by casting to int64_t
instead.

3) Setting global variables of Allocation type in a script group was
broken. The special size value -1 was used to indicate the value is an
Allocation. However, size was casted to size_t in the JNI code.
Fixed that by using signed integers.

Change-Id: Ifff099a76be7707df7b67c388395f5a00f9cae66
2015-11-13 10:00:12 -08:00
Miao Wang
ba8766c5db [RenderScript] Add null check for return values of JNI
Get<TYPE>ArrayElements.

Bug: 20760800
Change-Id: I6ba56933a71721da88d31dbf74c48d42a924305a
2015-10-13 10:44:38 -07:00
Pirama Arumuga Nainar
115b4117a0 Fix punctuation and typos in AllocationAdapter's documentation.
Change-Id: I5574ff201b857a29f30ebe8413dbe4128dcff3ae
2015-10-08 19:51:11 +00:00
Pirama Arumuga Nainar
c9390c8baf am 46b51097: Merge "Safely handle interrupts during Thread.join()"
* commit '46b51097b92900866ac5b25762f622d3ceb1be5d':
  Safely handle interrupts during Thread.join()
2015-10-05 23:33:38 +00:00
Pirama Arumuga Nainar
83461d73bc Safely handle interrupts during Thread.join()
Interrupt current thread if InterruptedException is received during
Thread.join().  Also, log the interruption.

Change-Id: I452124915ea3f19610e6d4a3411d741f2f604af2
2015-10-05 15:45:47 -07:00
Pirama Arumuga Nainar
5fbb245230 am ca3e5aea: Merge "Retry if interrupted before mMessageThread has joined"
* commit 'ca3e5aeaa65ae1d77ce92f082ab789933eb18237':
  Retry if interrupted before mMessageThread has joined
2015-10-02 22:08:11 +00:00
Pirama Arumuga Nainar
2f25ce7753 Retry if interrupted before mMessageThread has joined
Bug: 24342101

If interrupted during mMessageThread.join(), retry the join instead of
assuming the thread has joined and continuing.  Continuing to destroy
the context will cause a segfault when the message thread attempts to
use the destroyed context.

Change-Id: I3213091a0e996449bceb403dffca3063786d5a65
2015-10-02 21:42:12 +00:00
Miao Wang
05420e77f5 am 134c504a: Merge "[RenderScript] pass correct length of ains to BLAS functions"
* commit '134c504a3ea687a0ea875057792e66705ddbfce7':
  [RenderScript] pass correct length of ains to BLAS functions
2015-09-30 23:44:22 +00:00
Miao Wang
134c504a3e Merge "[RenderScript] pass correct length of ains to BLAS functions" 2015-09-30 22:53:18 +00:00
Miao Wang
0b34f2a3c5 [RenderScript] pass correct length of ains to BLAS functions
bug: 24540091
Change-Id: Ia541bcbee07125c4caf3e0f4863702a3c0b929d5
2015-09-30 15:38:07 -07:00
Elliott Hughes
b57dd722f1 resolved conflicts for a884d81e to stage-aosp-master
Change-Id: Ice485967fa96f13786024b6939b826638e906ff0
2015-09-24 10:01:32 -07:00
Daniel Micay
76f6a86de2 constify JNINativeMethod function pointer tables
Change-Id: I4036c924958221cbc644724f8eb01c5de3cd7954
2015-09-22 17:10:35 -04:00
Stephen McGroarty
88891e63c0 Remove the CREATE_FLAG_OPT_LEVEL_0 from the Java API.
The flag was previously used to set the optimization level
of the bcc compiler to -O0. However, this functionality is
now accomplished through deriving the optimization level
from the input bitcode. That patch can be found here:
https://android-review.googlesource.com/169330

Change-Id: I9c57d941bb35c6f737a31fcd74f31d9de25a16a8
Signed-off-by: Stephen McGroarty <stephen@codeplay.com>
2015-09-02 16:11:28 +01:00
Stephen Hines
b3a1674a47 am ed3ffe0f: am 6430812a: Merge "RenderScript: implement a Script entry point for calling a reduce-style kernel."
* commit 'ed3ffe0fc86de016ff2b4231e2fcc74a6119f6c7':
  RenderScript: implement a Script entry point for calling a reduce-style kernel.
2015-07-23 22:54:59 +00:00
Stephen Hines
6430812a93 Merge "RenderScript: implement a Script entry point for calling a reduce-style kernel." 2015-07-23 22:26:05 +00:00
Matt Wala
36eb1f74b3 RenderScript: implement a Script entry point for calling a
reduce-style kernel.

Bug: 22631253

This adds a new (currently hidden) API to the Script class and the
corresponding code for the RenderScript JNI layer.

Change-Id: I40f19aaeb90411b859bd6b0bffc3f071fa327c21
2015-07-21 11:07:10 -07:00
Miao Wang
3fd9bf4e24 am 15d68941: Merge "[RenderScript] Add docs advising users about dstAtop bug." into mnc-dev
* commit '15d6894170f2ee1a6eae57c915fcc27a56c9de17':
  [RenderScript] Add docs advising users about dstAtop bug.
2015-07-20 23:52:46 +00:00
Miao Wang
37e1d0ce1e [RenderScript] Add docs advising users about dstAtop bug.
Bug: 22047392
Change-Id: I736a697276020687c20dff515aabb1be1776f8c0
(cherry picked from commit ffb1a9bed0788d3547f085bfb9d254004e0db1e3)
2015-07-20 16:44:14 -07:00
Miao Wang
ffb1a9bed0 [RenderScript] Add docs advising users about dstAtop bug.
Bug: 22047392
Change-Id: I736a697276020687c20dff515aabb1be1776f8c0
2015-07-20 16:04:59 -07:00
Stephen Hines
dd67c9d6a8 am 0f5b7bc2: am 79a1bde2: Merge "Add a flag to the API to specify -O0 on the bcc command line."
* commit '0f5b7bc2fe2ae554ab1f044eb5b10aab5f4812cb':
  Add a flag to the API to specify -O0 on the bcc command line.
2015-07-17 23:14:36 +00:00
Stephen Hines
79a1bde2e0 Merge "Add a flag to the API to specify -O0 on the bcc command line." 2015-07-17 22:45:16 +00:00
verena beckham
c9659ea3a2 Add a flag to the API to specify -O0 on the bcc command line.
Add a flag CREATE_FLAG_OPT_LEVEL_0 to set the optimization level to 0 when calling bcc.
This will result in an object file that is easier to debug.

Change-Id: I0384dca098fa0d9ae0f2e02e798da9de342c1122
Signed-off-by: verena beckham <verena@codeplay.com>
2015-07-16 19:45:09 -07:00
Miao Wang
3ef2041cee fix BNNM docs
bug: 22507076
Change-Id: I5fdffdde597d97b1dde77574d096b81bff4aa382
(cherry picked from commit d7d413ad0bfaea2d4bb4adcd8011239c2f5f74ae)
2015-07-16 10:28:35 -07:00
Miao Wang
9ee3b6f136 am ad904cf3: Merge "fix BNNM docs" into mnc-dev
* commit 'ad904cf34219897da731eb65f9de53176cc39b20':
  fix BNNM docs
2015-07-15 22:33:14 +00:00
Miao Wang
d7d413ad0b fix BNNM docs
bug: 22507076
Change-Id: I5fdffdde597d97b1dde77574d096b81bff4aa382
2015-07-15 11:35:28 -07:00
Miao Wang
c02720316d resolved conflicts for merge of a1867fb0 to mnc-dev-plus-aosp
Change-Id: Id0266c63c98b4cb37f49eb2e0fb9a98cbc7ee1de
2015-06-30 23:35:23 -07:00
Miao Wang
2514806817 [RenderScript] update the type of offsets for BLAS.BNNM
bug: 22184114

Change-Id: I7e7132aa3563f32de32640567b381f8f5bddf491
(cherry picked from commit 6099ee6e081904e73e0fad331e326b0607b6b1dc)
2015-06-30 22:29:47 -07:00
John Hoford
d6ae785292 am 3791d011: am 6463dd52: Merge "add comment about xor not being porter/duff Bug: 21934855"
* commit '3791d0112ef38c95b8de8b73c5a1f5b074e6e6e9':
  add comment about xor not being porter/duff Bug: 21934855
2015-06-30 22:59:18 +00:00
John Hoford
6ba4cb7773 add comment about xor not being porter/duff
Bug: 21934855

Change-Id: I99394bd8a7a40a220c05118564b532f2533da38a
2015-06-30 19:53:41 +00:00
Miao Wang
6099ee6e08 [RenderScript] update the type of offsets for BLAS.BNNM
bug: 22184114

Change-Id: I7e7132aa3563f32de32640567b381f8f5bddf491
2015-06-30 10:12:54 -07:00
Yang Ni
3020953243 Add Java doc comments on script group name reuse
b/21999787

Change-Id: Id9a7bad4ce91f3afdd82a1288cf94430f3aef9bb
(cherry picked from commit dbb6fd58a4b113f8761ce825ad5b91e50c170971)
2015-06-29 15:38:25 -07:00
Yang Ni
524d9b663d am f7e55607: am fd5ec27b: Merge "Add Java doc comments on script group name reuse" into mnc-dev
* commit 'f7e5560703aa1e71f1e7603dfcd4f855a0377b31':
  Add Java doc comments on script group name reuse
2015-06-29 21:23:18 +00:00
Yang Ni
dbb6fd58a4 Add Java doc comments on script group name reuse
b/21999787

Change-Id: Id9a7bad4ce91f3afdd82a1288cf94430f3aef9bb
2015-06-28 16:09:57 -07:00
Miao Wang
1db4e1a1cb am 1fff1371: am df584d34: Merge "[RenderScript] Add documentation for IntrinsicBLAS, and @hide annotations." into mnc-dev
* commit '1fff1371b31a0194330a98fe6882471ca61f44eb':
  [RenderScript] Add documentation for IntrinsicBLAS, and @hide annotations.
2015-06-19 21:49:20 +00:00
Miao Wang
df584d34b5 Merge "[RenderScript] Add documentation for IntrinsicBLAS, and @hide annotations." into mnc-dev 2015-06-19 21:19:56 +00:00
Yang Ni
d6909748d3 am 44095579: am 159f442f: Merge "Unpublish methods in class ScriptGroup.Binding" into mnc-dev
* commit '44095579186a59b6856af665a6b30743e35a2b7b':
  Unpublish methods in class ScriptGroup.Binding
2015-06-19 13:56:44 +00:00
Miao Wang
fb675a5396 [RenderScript] Add documentation for IntrinsicBLAS, and @hide
annotations.

bug: 21039492
Change-Id: I50a6beca22c9e524a76925d8e497b2618177491d
2015-06-17 15:17:18 -07:00
Yang Ni
77eba48889 Unpublish methods in class ScriptGroup.Binding
b/21187932

Made it an opaque class, since there is no need for a user to
inspect its fields after creation.

Change-Id: I9101afdecc5e25bb484d060be2a08c470faa92e5
2015-06-17 15:06:30 -07:00
Yang Ni
d9f5f0269d Fixed ScriptGroup for outputs to globals
b/21187932

Dependency from one kernel to another kernel -- where one reads the
other's output to a global allocation -- was not handled correctly.
This CL fixed that. Needed to make a new CTS test pass.

Change-Id: I500f9cac9d89bcaec7c186e942ba4a7d413daadb
(cherry picked from commit 85858718c0fc8f4f17ee18e5d62ec0614a8bc780)
2015-06-08 15:08:19 -07:00