Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
5b42f6f2
Commit
5b42f6f2
authored
13 years ago
by
Oz Linden
Browse files
Options
Downloads
Patches
Plain Diff
modify gpu_table_tester to lowercase things the way that the real gpu table parser does
parent
6c253482
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
scripts/gpu_table_tester
+8
-4
8 additions, 4 deletions
scripts/gpu_table_tester
with
8 additions
and
4 deletions
scripts/gpu_table_tester
+
8
−
4
View file @
5b42f6f2
...
@@ -62,14 +62,14 @@ die "Must specify a --gpu-table <gpu_table.txt> value"
...
@@ -62,14 +62,14 @@ die "Must specify a --gpu-table <gpu_table.txt> value"
open
(
GPUS
,
"
<
$GpuTable
")
open
(
GPUS
,
"
<
$GpuTable
")
||
die
"
Failed to open gpu table '
$GpuTable
':
\n\t
$!
\n
";
||
die
"
Failed to open gpu table '
$GpuTable
':
\n\t
$!
\n
";
# Parse the GPU table into these table, indexed by the name
# Parse the GPU table into these table
s
, indexed by the name
my
%NameLine
;
# name -> line number on which a given name was found (catches duplicate names)
my
%NameLine
;
# name -> line number on which a given name was found (catches duplicate names)
my
%RecognizerLine
;
# name -> line number on which a given name was found (catches duplicate names)
my
%RecognizerLine
;
# name -> line number on which a given name was found (catches duplicate names)
my
%Name
;
# recognizer -> name
my
%Name
;
# recognizer -> name
my
%Recognizer
;
# name -> recognizer
my
%Recognizer
;
# name -> recognizer
my
%Class
;
# recognizer -> class
my
%Class
;
# recognizer -> class
my
%Supported
;
# recognizer -> supported
my
%Supported
;
# recognizer -> supported
my
@InOrder
;
#
records th
e order
of
the re
cognizers
my
@InOrder
;
#
lowercased recognizers in fil
e order
-
the
se
a
re
the ones really used to match
$Name
{'
UNRECOGNIZED
'}
=
'
UNRECOGNIZED
';
$Name
{'
UNRECOGNIZED
'}
=
'
UNRECOGNIZED
';
$NameLine
{'
UNRECOGNIZED
'}
=
'
(hard-coded)
';
# use this for error messages in table parsing
$NameLine
{'
UNRECOGNIZED
'}
=
'
(hard-coded)
';
# use this for error messages in table parsing
...
@@ -126,7 +126,8 @@ while (<GPUS>)
...
@@ -126,7 +126,8 @@ while (<GPUS>)
if
(
$errsOnLine
==
$ErrorsSeen
)
# no errors found on this line
if
(
$errsOnLine
==
$ErrorsSeen
)
# no errors found on this line
{
{
push
@InOrder
,
$regex
;
$lcregex
=
$regex
;
# the real gpu table parser lowercases each recognizer
push
@InOrder
,
$lcregex
;
$NameLine
{
$name
}
=
$INPUT_LINE_NUMBER
;
$NameLine
{
$name
}
=
$INPUT_LINE_NUMBER
;
$RecognizerLine
{
$regex
}
=
$INPUT_LINE_NUMBER
;
$RecognizerLine
{
$regex
}
=
$INPUT_LINE_NUMBER
;
$Name
{
$regex
}
=
$name
;
$Name
{
$regex
}
=
$name
;
...
@@ -142,10 +143,13 @@ print STDERR "\n" if $ErrorsSeen;
...
@@ -142,10 +143,13 @@ print STDERR "\n" if $ErrorsSeen;
exit
$ErrorsSeen
if
$TableOnly
;
exit
$ErrorsSeen
if
$TableOnly
;
my
%RecognizedBy
;
my
%RecognizedBy
;
while
(
<>
)
while
(
<>
)
# Loop over input lines
{
{
chomp
;
chomp
;
my
$lowerInput
=
$_
;
lc
lowerInput
;
# the real gpu table parser lowercases the input string
my
$recognizer
;
my
$recognizer
;
$RecognizedBy
{
$_
}
=
'
UNRECOGNIZED
';
$RecognizedBy
{
$_
}
=
'
UNRECOGNIZED
';
foreach
$recognizer
(
@InOrder
)
# note early exit if recognized
foreach
$recognizer
(
@InOrder
)
# note early exit if recognized
...
...
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