-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
float64 related entities generation fixed
- Loading branch information
Showing
9 changed files
with
53 additions
and
61 deletions.
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
File renamed without changes.
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
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,9 @@ | ||
import 'generate_float64_matrix_data_manager.dart'; | ||
import 'generate_float64_matrix_iterator.dart'; | ||
import 'generate_float64x2_vector.dart'; | ||
|
||
void main() { | ||
generateFloat64x2Vector(); | ||
generateFloat64MatrixIterator(); | ||
generateFloat64MatrixDataManager(); | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,12 @@ | ||
import 'dart:async'; | ||
import 'dart:io'; | ||
|
||
import 'package:path/path.dart' as p; | ||
import 'generate_class_from_template.dart'; | ||
|
||
const _templateFileName = 'lib/src/vector/float32x4_vector.dart'; | ||
const _targetFileName = 'lib/src/vector/float64x2_vector.gen.dart'; | ||
const _warningTextComment = '/* This file is auto generated, do not change it manually */\n\n'; | ||
Future<Null> generateFloat64x2Vector() => generateClassFromTemplate( | ||
'lib/src/vector/float64x2_vector.dart', | ||
'lib/src/vector/float32x4_vector.dart', | ||
); | ||
|
||
Future<Null> main() async { | ||
await generateFloat64x2Vector(); | ||
} | ||
|
||
Future<Null> generateFloat64x2Vector() async { | ||
final File libraryFile = File(_targetFileName); | ||
|
||
if (libraryFile.existsSync()) { | ||
await libraryFile.delete(); | ||
} | ||
|
||
await _processFile(_templateFileName); | ||
} | ||
|
||
Future<Null> _processFile(String inputFileName) async { | ||
final File inputFile = File(inputFileName); | ||
|
||
final String input = await inputFile.readAsString(); | ||
final String output = '$_warningTextComment${_convertToFloat64x2Vector(input)}'; | ||
|
||
final String outputFileName = _targetFileName; | ||
final Directory dir = Directory(p.dirname(outputFileName)); | ||
|
||
await dir.create(recursive: true); | ||
|
||
final File outputFile = File(outputFileName); | ||
await outputFile.writeAsString(output); | ||
} | ||
|
||
String _convertToFloat64x2Vector(String input) => input | ||
.replaceAll('Float32x4List', 'Float64x2List') | ||
.replaceAll('Float32x4', 'Float64x2') | ||
.replaceAll('Float32List', 'Float64List') | ||
.replaceAll('DType.float32', 'DType.float64') | ||
.replaceAll('setFloat32', 'setFloat64'); |