New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8262096: Vector API fails to work due to VectorShape initialization exception #2722
Closed
Closed
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
09b49f2
8262096: Vector API fails to work due to VectorShape initialization e…
DamonFool 724b36d
The numerator should be 8 (byte)
DamonFool aa475b0
Update the jtreg test
DamonFool bbe6150
Remove -XX:TieredStopAtLevel=3
DamonFool 9047c6c
Revert changes
DamonFool c03e278
Merge branch 'master' into JDK-8262096
DamonFool b67b232
Fix in jdk/incubator/vector/VectorShape.java
DamonFool 7940241
Add requires vm.compiler2.enabled
DamonFool d3b4cc3
Add VectorShape.getMaxVectorBitSize
DamonFool File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
test/hotspot/jtreg/compiler/vectorapi/VectorShapeInitTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
package compiler.vectorapi; | ||
|
||
import jdk.incubator.vector.DoubleVector; | ||
import jdk.incubator.vector.VectorOperators; | ||
import jdk.incubator.vector.VectorSpecies; | ||
|
||
/* | ||
* @test | ||
* @bug 8262096 | ||
* @summary Test the initialization of vector shapes | ||
* @modules jdk.incubator.vector | ||
* @run main/othervm -XX:MaxVectorSize=8 compiler.vectorapi.VectorShapeInitTest | ||
* @run main/othervm -XX:MaxVectorSize=4 compiler.vectorapi.VectorShapeInitTest | ||
*/ | ||
|
||
public class VectorShapeInitTest { | ||
static final VectorSpecies<Double> SPECIES = DoubleVector.SPECIES_64; | ||
static double[] a = new double[64]; | ||
static double[] r = new double[64]; | ||
|
||
public static void main(String[] args) { | ||
DoubleVector av = DoubleVector.fromArray(SPECIES, a, 0); | ||
av.lanewise(VectorOperators.ABS).intoArray(r, 0); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am uncertain of the units here. Is the numerator in bits and the denominator in bytes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Paul for your review.
Oops, the numerator should be 8 (bytes).
Updated.
Testing of jdk/incubator/vector (MaxVector=default/8/4 or without C2) is still fine.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, was the test
VectorShapeInitTest
passing prior to the fix of the numerator?Perhaps we should be testing more directly on
VectorShape.S_Max_BIT.vectorBitSize()
andVectorShape.preferredShape
?Also, perhaps we can run with C2 disabled, with
-XX:TieredStopAtLevel=3
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch had been updated.
Any comments?
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reusing PreferredSpeciesTest is a good idea.
I now realize that C2 needs to be compiled out to trigger some other cases. In that case I think we can remove the execution with
-XX:TieredStopAtLevel=x
. The test will get executed with various HotSpot configurations by the test infrastructure, eventually...Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks.