• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

common-workflow-language / cwljava / #423

17 Dec 2025 10:33AM UTC coverage: 56.982% (-1.0%) from 57.972%
#423

push

github

web-flow
refresh 2025-12 (including extensions) (#218)

* "id" is a required field in for Parameters and WorkflowSteps
* regen; drop CommandLineBindableImpl; add optional CWL extensions

185 of 577 new or added lines in 21 files covered. (32.06%)

10 existing lines in 10 files now uncovered.

7892 of 13850 relevant lines covered (56.98%)

0.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

41.67
/src/main/java/org/commonwl/cwlsdk/cwl1_2/CUDARequirementImpl.java
1
// Copyright Common Workflow Language project contributors
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//      http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15
package org.commonwl.cwlsdk.cwl1_2;
16

17
import org.commonwl.cwlsdk.cwl1_2.utils.LoaderInstances;
18
import org.commonwl.cwlsdk.cwl1_2.utils.LoadingOptions;
19
import org.commonwl.cwlsdk.cwl1_2.utils.LoadingOptionsBuilder;
20
import org.commonwl.cwlsdk.cwl1_2.utils.SaveableImpl;
21
import org.commonwl.cwlsdk.cwl1_2.utils.ValidationException;
22

23
/**
24
* Auto-generated class implementation for <I>http://commonwl.org/cwltool#CUDARequirement</I><BR> <BLOCKQUOTE>
25
 Require support for NVIDA CUDA (GPU hardware acceleration).
26
  </BLOCKQUOTE>
27
 */
28
public class CUDARequirementImpl extends SaveableImpl implements CUDARequirement {
29
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
30
  private java.util.Map<String, Object> extensionFields_ =
1✔
31
      new java.util.HashMap<String, Object>();
32
  public LoadingOptions getLoadingOptions() {
NEW
33
    return this.loadingOptions_;
×
34
  }
35
  public java.util.Map<String, Object> getExtensionFields() {
NEW
36
    return this.extensionFields_;
×
37
  }
38

39
  private String class_;
40

41
  /**
42
   * Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/class</I><BR>
43
   * <BLOCKQUOTE>
44
   * cwltool:CUDARequirement   * </BLOCKQUOTE>
45
   */
46

47
  public String getClass_() {
NEW
48
    return this.class_;
×
49
  }
50

51
  private Object cudaComputeCapability;
52

53
  /**
54
   * Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/cudaComputeCapability</I><BR>
55
   * <BLOCKQUOTE>
56
   * CUDA hardware capability required to run the software, in X.Y
57
   * format.
58
   * 
59
   * * If this is a single value, it defines only the minimum
60
   *   compute capability.  GPUs with higher capability are also
61
   *   accepted.
62
   * 
63
   * * If it is an array value, then only select GPUs with compute
64
   *   capabilities that explicitly appear in the array.
65
   *    * </BLOCKQUOTE>
66
   */
67

68
  public Object getCudaComputeCapability() {
NEW
69
    return this.cudaComputeCapability;
×
70
  }
71

72
  private Object cudaDeviceCountMax;
73

74
  /**
75
   * Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/cudaDeviceCountMax</I><BR>
76
   * <BLOCKQUOTE>
77
   * Maximum number of GPU devices to request.  If not specified,
78
   * same as `cudaDeviceCountMin`.
79
   *    * </BLOCKQUOTE>
80
   */
81

82
  public Object getCudaDeviceCountMax() {
NEW
83
    return this.cudaDeviceCountMax;
×
84
  }
85

86
  private Object cudaDeviceCountMin;
87

88
  /**
89
   * Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/cudaDeviceCountMin</I><BR>
90
   * <BLOCKQUOTE>
91
   * Minimum number of GPU devices to request.  If not specified,
92
   * same as `cudaDeviceCountMax`.  If neither are specified,
93
   * default 1.
94
   *    * </BLOCKQUOTE>
95
   */
96

97
  public Object getCudaDeviceCountMin() {
NEW
98
    return this.cudaDeviceCountMin;
×
99
  }
100

101
  private String cudaVersionMin;
102

103
  /**
104
   * Getter for property <I>http://commonwl.org/cwltool#CUDARequirement/cudaVersionMin</I><BR>
105
   * <BLOCKQUOTE>
106
   * Minimum CUDA version to run the software, in X.Y format.  This
107
   * corresponds to a CUDA SDK release.  When running directly on
108
   * the host (not in a container) the host must have a compatible
109
   * CUDA SDK (matching the exact version, or, starting with CUDA
110
   * 11.3, matching major version).  When run in a container, the
111
   * container image should provide the CUDA runtime, and the host
112
   * driver is injected into the container.  In this case, because
113
   * CUDA drivers are backwards compatible, it is possible to
114
   * use an older SDK with a newer driver across major versions.
115
   * 
116
   * See https://docs.nvidia.com/deploy/cuda-compatibility/ for
117
   * details.
118
   *    * </BLOCKQUOTE>
119
   */
120

121
  public String getCudaVersionMin() {
NEW
122
    return this.cudaVersionMin;
×
123
  }
124

125
  /**
126
   * Used by {@link org.commonwl.cwlsdk.cwl1_2.utils.RootLoader} to construct instances of CUDARequirementImpl.
127
   *
128
   * @param __doc_            Document fragment to load this record object from (presumably a
129
                              {@link java.util.Map}).
130
   * @param __baseUri_        Base URI to generate child document IDs against.
131
   * @param __loadingOptions  Context for loading URIs and populating objects.
132
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
133
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
134
   *                             or validation of fields fails.
135
   */
136
  public CUDARequirementImpl(
137
      final Object __doc_,
138
      final String __baseUri_,
139
      LoadingOptions __loadingOptions,
140
      final String __docRoot_) {
141
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
142
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
143
    // generated names.
144
    String __baseUri = __baseUri_;
1✔
145
    String __docRoot = __docRoot_;
1✔
146
    if (!(__doc_ instanceof java.util.Map)) {
1✔
NEW
147
      throw new ValidationException("CUDARequirementImpl called on non-map");
×
148
    }
149
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
150
    final java.util.List<ValidationException> __errors =
1✔
151
        new java.util.ArrayList<ValidationException>();
152
    if (__loadingOptions != null) {
1✔
153
      this.loadingOptions_ = __loadingOptions;
1✔
154
    }
155
    String class_;
156
    try {
157
      class_ =
1✔
158
          LoaderInstances
159
              .uri_StringInstance_False_True_None_None
160
              .loadField(__doc.get("class"), __baseUri, __loadingOptions);
1✔
NEW
161
    } catch (ValidationException e) {
×
NEW
162
      class_ = null; // won't be used but prevents compiler from complaining.
×
NEW
163
      final String __message = "the `class` field is not valid because:";
×
NEW
164
      __errors.add(new ValidationException(__message, e));
×
165
    }
1✔
166
    Object cudaComputeCapability;
167
    try {
168
      cudaComputeCapability =
1✔
169
          LoaderInstances
170
              .union_of_StringInstance_or_array_of_StringInstance
NEW
171
              .loadField(__doc.get("cudaComputeCapability"), __baseUri, __loadingOptions);
×
172
    } catch (ValidationException e) {
1✔
173
      cudaComputeCapability = null; // won't be used but prevents compiler from complaining.
1✔
174
      final String __message = "the `cudaComputeCapability` field is not valid because:";
1✔
175
      __errors.add(new ValidationException(__message, e));
1✔
NEW
176
    }
×
177
    Object cudaDeviceCountMax;
178

179
    if (__doc.containsKey("cudaDeviceCountMax")) {
1✔
180
      try {
NEW
181
        cudaDeviceCountMax =
×
182
            LoaderInstances
183
                .union_of_NullInstance_or_IntegerInstance_or_ExpressionLoader
NEW
184
                .loadField(__doc.get("cudaDeviceCountMax"), __baseUri, __loadingOptions);
×
NEW
185
      } catch (ValidationException e) {
×
NEW
186
        cudaDeviceCountMax = null; // won't be used but prevents compiler from complaining.
×
NEW
187
        final String __message = "the `cudaDeviceCountMax` field is not valid because:";
×
NEW
188
        __errors.add(new ValidationException(__message, e));
×
NEW
189
      }
×
190

191
    } else {
192
      cudaDeviceCountMax = null;
1✔
193
    }
194
    Object cudaDeviceCountMin;
195

196
    if (__doc.containsKey("cudaDeviceCountMin")) {
1✔
197
      try {
NEW
198
        cudaDeviceCountMin =
×
199
            LoaderInstances
200
                .union_of_NullInstance_or_IntegerInstance_or_ExpressionLoader
NEW
201
                .loadField(__doc.get("cudaDeviceCountMin"), __baseUri, __loadingOptions);
×
NEW
202
      } catch (ValidationException e) {
×
NEW
203
        cudaDeviceCountMin = null; // won't be used but prevents compiler from complaining.
×
NEW
204
        final String __message = "the `cudaDeviceCountMin` field is not valid because:";
×
NEW
205
        __errors.add(new ValidationException(__message, e));
×
NEW
206
      }
×
207

208
    } else {
209
      cudaDeviceCountMin = null;
1✔
210
    }
211
    String cudaVersionMin;
212
    try {
213
      cudaVersionMin =
1✔
214
          LoaderInstances
215
              .StringInstance
NEW
216
              .loadField(__doc.get("cudaVersionMin"), __baseUri, __loadingOptions);
×
217
    } catch (ValidationException e) {
1✔
218
      cudaVersionMin = null; // won't be used but prevents compiler from complaining.
1✔
219
      final String __message = "the `cudaVersionMin` field is not valid because:";
1✔
220
      __errors.add(new ValidationException(__message, e));
1✔
NEW
221
    }
×
222
    if (!__errors.isEmpty()) {
1✔
223
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
224
    }
NEW
225
    this.class_ = (String) class_;
×
NEW
226
    this.cudaComputeCapability = (Object) cudaComputeCapability;
×
NEW
227
    this.cudaDeviceCountMax = (Object) cudaDeviceCountMax;
×
NEW
228
    this.cudaDeviceCountMin = (Object) cudaDeviceCountMin;
×
NEW
229
    this.cudaVersionMin = (String) cudaVersionMin;
×
NEW
230
    for (String field:__doc.keySet()) {
×
NEW
231
      if (!attrs.contains(field)) {
×
NEW
232
        if (field.contains(":")) {
×
NEW
233
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
234
          extensionFields_.put(expanded_field, __doc.get(field));
×
235
        }
236
      }
NEW
237
    }
×
NEW
238
  }
×
239
  private java.util.List<String> attrs = java.util.Arrays.asList("class", "cudaComputeCapability", "cudaDeviceCountMax", "cudaDeviceCountMin", "cudaVersionMin");
1✔
240
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc