Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Aparapi Examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
We are moving to Forgejo!
You are on a read-only GitLab instance.
Show more breadcrumbs
Aparapi
Aparapi Examples
Commits
2b72eded
Commit
2b72eded
authored
10 years ago
by
log2
Browse files
Options
Downloads
Patches
Plain Diff
Substituted calls to String.replace(String, String) with
String.replace(char, char), in order to enhance performance
parent
02731f23
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
com.amd.aparapi/src/java/com/amd/aparapi/internal/writer/KernelWriter.java
+6
-6
6 additions, 6 deletions
...rc/java/com/amd/aparapi/internal/writer/KernelWriter.java
with
6 additions
and
6 deletions
com.amd.aparapi/src/java/com/amd/aparapi/internal/writer/KernelWriter.java
+
6
−
6
View file @
2b72eded
...
...
@@ -273,9 +273,9 @@ public abstract class KernelWriter extends BlockWriter{
public
final
static
String
__private
=
"__private"
;
public
final
static
String
LOCAL_ANNOTATION_NAME
=
"L"
+
Local
.
class
.
getName
().
replace
(
"."
,
"/"
)
+
";"
;
public
final
static
String
LOCAL_ANNOTATION_NAME
=
"L"
+
Local
.
class
.
getName
().
replace
(
'.'
,
'/'
)
+
";"
;
public
final
static
String
CONSTANT_ANNOTATION_NAME
=
"L"
+
Constant
.
class
.
getName
().
replace
(
"."
,
"/"
)
+
";"
;
public
final
static
String
CONSTANT_ANNOTATION_NAME
=
"L"
+
Constant
.
class
.
getName
().
replace
(
'.'
,
'/'
)
+
";"
;
@Override
public
void
write
(
Entrypoint
_entryPoint
)
throws
CodeGenException
{
final
List
<
String
>
thisStruct
=
new
ArrayList
<
String
>();
...
...
@@ -341,7 +341,7 @@ public abstract class KernelWriter extends BlockWriter{
String
className
=
null
;
if
(
signature
.
startsWith
(
"L"
))
{
// Turn Lcom/amd/javalabs/opencl/demo/DummyOOA; into com_amd_javalabs_opencl_demo_DummyOOA for example
className
=
(
signature
.
substring
(
1
,
signature
.
length
()
-
1
)).
replace
(
"/"
,
"_"
);
className
=
(
signature
.
substring
(
1
,
signature
.
length
()
-
1
)).
replace
(
'/'
,
'_'
);
// if (logger.isLoggable(Level.FINE)) {
// logger.fine("Examining object parameter: " + signature + " new: " + className);
// }
...
...
@@ -475,7 +475,7 @@ public abstract class KernelWriter extends BlockWriter{
for
(
final
ClassModel
cm
:
_entryPoint
.
getObjectArrayFieldsClasses
().
values
())
{
final
ArrayList
<
FieldEntry
>
fieldSet
=
cm
.
getStructMembers
();
if
(
fieldSet
.
size
()
>
0
)
{
final
String
mangledClassName
=
cm
.
getClassWeAreModelling
().
getName
().
replace
(
"."
,
"_"
);
final
String
mangledClassName
=
cm
.
getClassWeAreModelling
().
getName
().
replace
(
'.'
,
'_'
);
newLine
();
write
(
"typedef struct "
+
mangledClassName
+
"_s{"
);
in
();
...
...
@@ -572,11 +572,11 @@ public abstract class KernelWriter extends BlockWriter{
// Call to an object member or superclass of member
for
(
final
ClassModel
c
:
_entryPoint
.
getObjectArrayFieldsClasses
().
values
())
{
if
(
mm
.
getMethod
().
getClassModel
()
==
c
)
{
write
(
"__global "
+
mm
.
getMethod
().
getClassModel
().
getClassWeAreModelling
().
getName
().
replace
(
"."
,
"_"
)
write
(
"__global "
+
mm
.
getMethod
().
getClassModel
().
getClassWeAreModelling
().
getName
().
replace
(
'.'
,
'_'
)
+
" *this"
);
break
;
}
else
if
(
mm
.
getMethod
().
getClassModel
().
isSuperClass
(
c
.
getClassWeAreModelling
()))
{
write
(
"__global "
+
c
.
getClassWeAreModelling
().
getName
().
replace
(
"."
,
"_"
)
+
" *this"
);
write
(
"__global "
+
c
.
getClassWeAreModelling
().
getName
().
replace
(
'.'
,
'_'
)
+
" *this"
);
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment